Describe the bug
The opensearch_api source _bulk endpoint returns an empty HTTP 200 response with no body. Clients using RestHighLevelClient (Flink OpenSearch Connector, Logstash, opensearch-py) expect a JSON response matching the OpenSearch _bulk API format: {took, errors, items[]} and fail with "Unable to parse response body" / NullPointerException.
To Reproduce
- Configure Data Prepper with
opensearch_api source
- Send a
_bulk request from any standard OpenSearch client (e.g. Flink OpenSearch Connector, opensearch-py, curl)
- Observe empty response body - no JSON returned
Expected behavior
The _bulk endpoint should return a JSON response with {took, errors, items[]} matching the OpenSearch Bulk API response format, so standard clients can parse it without error.
Screenshots
N/A
Environment (please complete the following information):
- OS: Linux
- Version: Data Prepper 2.15.1 / main branch
Additional context
Forum report: https://forum.opensearch.org/t/data-prepper-opensearch-api-return-value-for-bulk-endpoint-is-wrong/28068
The issue is in OpenSearchAPIService.processBulkRequest() which returns HttpResponse.of(HttpStatus.OK) with no body.
Describe the bug
The
opensearch_apisource_bulkendpoint returns an empty HTTP 200 response with no body. Clients usingRestHighLevelClient(Flink OpenSearch Connector, Logstash, opensearch-py) expect a JSON response matching the OpenSearch_bulkAPI format:{took, errors, items[]}and fail with "Unable to parse response body" / NullPointerException.To Reproduce
opensearch_apisource_bulkrequest from any standard OpenSearch client (e.g. Flink OpenSearch Connector, opensearch-py, curl)Expected behavior
The
_bulkendpoint should return a JSON response with{took, errors, items[]}matching the OpenSearch Bulk API response format, so standard clients can parse it without error.Screenshots
N/A
Environment (please complete the following information):
Additional context
Forum report: https://forum.opensearch.org/t/data-prepper-opensearch-api-return-value-for-bulk-endpoint-is-wrong/28068
The issue is in
OpenSearchAPIService.processBulkRequest()which returnsHttpResponse.of(HttpStatus.OK)with no body.