Skip to content

Add ByteDecoder for opensearch_api source to support Kafka buffer#6879

Open
divakarsingh wants to merge 1 commit into
opensearch-project:mainfrom
divakarsingh:fix/opensearch-api-kafka-buffer
Open

Add ByteDecoder for opensearch_api source to support Kafka buffer#6879
divakarsingh wants to merge 1 commit into
opensearch-project:mainfrom
divakarsingh:fix/opensearch-api-kafka-buffer

Conversation

@divakarsingh
Copy link
Copy Markdown

Description
The opensearch_api source did not work with Kafka buffer because no ByteDecoder was registered. When
buffer.isByteBuffer()=true, raw bytes are written but the consumer side had no way to reconstruct events from the NDJSON bulk
format.

This adds OpenSearchBulkByteDecoder which parses NDJSON bulk format back into Data Prepper events with correct metadata
attributes.

Issues Resolved
Resolves #6876

Check List

  • New functionality includes testing
  • Commits are signed with DCO (Signed-off-by)

@github-actions
Copy link
Copy Markdown

⚠️ License Header Violations Found

The following newly added files are missing required license headers:

  • data-prepper-plugins/opensearch-api-source/src/test/java/org/opensearch/dataprepper/plugins/source/opensearchapi/OpenSearchBulkByteDecoderTest.java

Please add the appropriate license header to each file and push your changes.

See the license header requirements: https://github.com/opensearch-project/data-prepper/blob/main/CONTRIBUTING.md#license-headers

The opensearch_api source did not work with Kafka buffer because no
ByteDecoder was registered. When buffer.isByteBuffer()=true, raw bytes
are written but the consumer side had no way to reconstruct events from
the NDJSON bulk format.

This adds OpenSearchBulkByteDecoder which parses NDJSON bulk format
(action/metadata + document line pairs) back into Data Prepper events
with correct metadata attributes.

Resolves opensearch-project#6876

Signed-off-by: Divakar Pratap Singh <divakar.p.singh@gmail.com>
@divakarsingh divakarsingh force-pushed the fix/opensearch-api-kafka-buffer branch from 220f714 to 2a982d8 Compare May 22, 2026 02:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] opensearch_api source does not work with Kafka buffer - no ByteDecoder registered

1 participant