From: Kai Moritz Date: Fri, 4 Nov 2022 07:42:48 +0000 (+0100) Subject: unsubscribe() im Fehlerfall ergänzt X-Git-Tag: spring-consumer--topicpartition-DEPRECATED~11 X-Git-Url: http://juplo.de/gitweb/?a=commitdiff_plain;h=d0ec626f3f7bdf72824b028a8341edf79540f756;p=demos%2Fkafka%2Ftraining unsubscribe() im Fehlerfall ergänzt --- diff --git a/src/main/java/de/juplo/kafka/SimpleConsumer.java b/src/main/java/de/juplo/kafka/SimpleConsumer.java index cab2fb8..5557a4d 100644 --- a/src/main/java/de/juplo/kafka/SimpleConsumer.java +++ b/src/main/java/de/juplo/kafka/SimpleConsumer.java @@ -75,7 +75,8 @@ public class SimpleConsumer } catch(Exception e) { - log.error("{} - Unexpected error: {}", id, e.toString()); + log.error("{} - Unexpected error: {}, unsubscribing!", id, e.toString()); + consumer.unsubscribe(); } finally {