Skip to content

Commit 571b163

Browse files
authored
The connector now dumps the response payload if (#23)
Elasticsearch had any errors ingesting the events. The Elasticsearch payload will be visible in the Kafka Connect worker logs at an `ERROR` log level. Signed-off-by: Graeme McRobert <[email protected]>
1 parent 9fa63b4 commit 571b163

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/main/java/com/ibm/eventstreams/connect/elasticsink/ElasticWriter.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -327,6 +327,11 @@ public void commit() throws ConnectException, RetriableException {
327327
throw new RetriableException(responseString);
328328
}
329329

330+
final JSONObject esResponse = new JSONObject(response.getContentAsString());
331+
if (esResponse.getBoolean("errors")) {
332+
log.error("Elasticsearch returned errors: {}", esResponse);
333+
}
334+
330335
// After a success, reset the number of failures.
331336
commitFailures = 0;
332337
}

0 commit comments

Comments
 (0)