From 54ae9a8e8d789292bd83a6bda1d12ac8ba238164 Mon Sep 17 00:00:00 2001 From: Kai Moritz Date: Sun, 20 Jun 2021 13:59:00 +0200 Subject: [PATCH] Ignoring poision pills with illeagal state-changes --- .../payment/transfer/adapter/TransferConsumer.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/main/java/de/juplo/kafka/payment/transfer/adapter/TransferConsumer.java b/src/main/java/de/juplo/kafka/payment/transfer/adapter/TransferConsumer.java index 63fbef5..18f5383 100644 --- a/src/main/java/de/juplo/kafka/payment/transfer/adapter/TransferConsumer.java +++ b/src/main/java/de/juplo/kafka/payment/transfer/adapter/TransferConsumer.java @@ -105,6 +105,16 @@ public class TransferConsumer implements Runnable record.partition(), record.value()); } + catch (IllegalArgumentException e) + { + log.error( + "ignoring invalid message #{} on {}/{}: {}, message={}", + record.offset(), + record.topic(), + record.partition(), + e.getMessage(), + record.value()); + } } @EventListener -- 2.20.1