From a910647b2cdfdb29b48b362c807dcfff9d57c08c Mon Sep 17 00:00:00 2001 From: Jaromir Hamala Date: Mon, 9 Sep 2024 10:53:17 +0200 Subject: [PATCH] better msg pattern --- .../src/main/java/io/questdb/kafka/QuestDBSinkTask.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/connector/src/main/java/io/questdb/kafka/QuestDBSinkTask.java b/connector/src/main/java/io/questdb/kafka/QuestDBSinkTask.java index b26c382..4a803fd 100644 --- a/connector/src/main/java/io/questdb/kafka/QuestDBSinkTask.java +++ b/connector/src/main/java/io/questdb/kafka/QuestDBSinkTask.java @@ -255,7 +255,10 @@ private void onTcpSenderException(Exception e) { private void onHttpSenderException(Exception e) { closeSenderSilently(); - if (reporter != null & e.getMessage() != null && e.getMessage().contains("error in line")) { // hack to detect data parsing errors + if ( + (reporter != null && e.getMessage() != null) // hack to detect data parsing errors + && (e.getMessage().contains("error in line") || e.getMessage().contains("failed to parse line protocol")) + ) { // ok, we have a parsing error, let's try to send records one by one to find the problematic record // and we will report it to the error handler. the rest of the records will make it to QuestDB sender = createSender();