Skip to content

Commit e0f7328

Browse files
Revert HTTP data chunking changes for kafka buffer done in PR 4266 (#4329) (#4334)
Signed-off-by: Krishna Kondaka <[email protected]> Co-authored-by: Krishna Kondaka <[email protected]> (cherry picked from commit c8e010f) Co-authored-by: Krishna Kondaka <[email protected]>
1 parent 207d4d7 commit e0f7328

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

data-prepper-plugins/http-source/src/main/java/org/opensearch/dataprepper/plugins/source/loghttp/HTTPSource.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
import org.opensearch.dataprepper.model.record.Record;
2121
import org.opensearch.dataprepper.model.source.Source;
2222
import org.opensearch.dataprepper.model.codec.ByteDecoder;
23-
import org.opensearch.dataprepper.model.codec.JsonObjectDecoder;
23+
import org.opensearch.dataprepper.model.codec.JsonDecoder;
2424
import com.linecorp.armeria.server.HttpService;
2525
import com.linecorp.armeria.server.Server;
2626
import com.linecorp.armeria.server.ServerBuilder;
@@ -64,7 +64,7 @@ public HTTPSource(final HTTPSourceConfig sourceConfig, final PluginMetrics plugi
6464
this.sourceConfig = sourceConfig;
6565
this.pluginMetrics = pluginMetrics;
6666
this.pipelineName = pipelineDescription.getPipelineName();
67-
this.byteDecoder = new JsonObjectDecoder();
67+
this.byteDecoder = new JsonDecoder();
6868
this.certificateProviderFactory = new CertificateProviderFactory(sourceConfig);
6969
final PluginModel authenticationConfiguration = sourceConfig.getAuthentication();
7070
final PluginSetting authenticationPluginSetting;

data-prepper-plugins/http-source/src/main/java/org/opensearch/dataprepper/plugins/source/loghttp/LogHTTPService.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -87,9 +87,9 @@ private HttpResponse processRequest(final AggregatedHttpRequest aggregatedHttpRe
8787
}
8888
try {
8989
if (buffer.isByteBuffer()) {
90-
for (final String json: jsonList) {
91-
buffer.writeBytes(json.getBytes(), null, bufferWriteTimeoutInMillis);
92-
}
90+
// jsonList is ignored in this path but parse() was done to make
91+
// sure that the data is in the expected json format
92+
buffer.writeBytes(content.array(), null, bufferWriteTimeoutInMillis);
9393
} else {
9494
final List<Record<Log>> records = jsonList.stream()
9595
.map(this::buildRecordLog)

0 commit comments

Comments
 (0)