From 0cb776f6a698fda66b655a769827864359f69cb1 Mon Sep 17 00:00:00 2001 From: Kai Moritz Date: Fri, 2 Sep 2022 05:18:23 +0200 Subject: [PATCH] =?utf8?q?Funktionsunabh=C3=A4ngiger=20Name=20f=C3=BCr=20d?= =?utf8?q?as=20erweiterte=20Interface=20RebalanceListener?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- src/main/java/de/juplo/kafka/ApplicationRebalanceListener.java | 2 +- src/main/java/de/juplo/kafka/EndlessConsumer.java | 2 +- ...areConsumerRebalanceListener.java => RebalanceListener.java} | 2 +- src/test/java/de/juplo/kafka/GenericApplicationTests.java | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) rename src/main/java/de/juplo/kafka/{PollIntervalAwareConsumerRebalanceListener.java => RebalanceListener.java} (68%) diff --git a/src/main/java/de/juplo/kafka/ApplicationRebalanceListener.java b/src/main/java/de/juplo/kafka/ApplicationRebalanceListener.java index b517d35..a751e75 100644 --- a/src/main/java/de/juplo/kafka/ApplicationRebalanceListener.java +++ b/src/main/java/de/juplo/kafka/ApplicationRebalanceListener.java @@ -13,7 +13,7 @@ import java.util.*; @RequiredArgsConstructor @Slf4j -public class ApplicationRebalanceListener implements PollIntervalAwareConsumerRebalanceListener +public class ApplicationRebalanceListener implements RebalanceListener { private final ApplicationRecordHandler recordHandler; private final AdderResults adderResults; diff --git a/src/main/java/de/juplo/kafka/EndlessConsumer.java b/src/main/java/de/juplo/kafka/EndlessConsumer.java index bdfb9bd..8f5eab3 100644 --- a/src/main/java/de/juplo/kafka/EndlessConsumer.java +++ b/src/main/java/de/juplo/kafka/EndlessConsumer.java @@ -25,7 +25,7 @@ public class EndlessConsumer implements Runnable private final String id; private final String topic; private final Consumer consumer; - private final PollIntervalAwareConsumerRebalanceListener rebalanceListener; + private final RebalanceListener rebalanceListener; private final RecordHandler recordHandler; private final Lock lock = new ReentrantLock(); diff --git a/src/main/java/de/juplo/kafka/PollIntervalAwareConsumerRebalanceListener.java b/src/main/java/de/juplo/kafka/RebalanceListener.java similarity index 68% rename from src/main/java/de/juplo/kafka/PollIntervalAwareConsumerRebalanceListener.java rename to src/main/java/de/juplo/kafka/RebalanceListener.java index c59418c..497a111 100644 --- a/src/main/java/de/juplo/kafka/PollIntervalAwareConsumerRebalanceListener.java +++ b/src/main/java/de/juplo/kafka/RebalanceListener.java @@ -3,7 +3,7 @@ package de.juplo.kafka; import org.apache.kafka.clients.consumer.ConsumerRebalanceListener; -public interface PollIntervalAwareConsumerRebalanceListener extends ConsumerRebalanceListener +public interface RebalanceListener extends ConsumerRebalanceListener { default void beforeNextPoll() {} diff --git a/src/test/java/de/juplo/kafka/GenericApplicationTests.java b/src/test/java/de/juplo/kafka/GenericApplicationTests.java index ff4a318..a8fa7ea 100644 --- a/src/test/java/de/juplo/kafka/GenericApplicationTests.java +++ b/src/test/java/de/juplo/kafka/GenericApplicationTests.java @@ -68,7 +68,7 @@ abstract class GenericApplicationTests @Autowired MongoProperties mongoProperties; @Autowired - PollIntervalAwareConsumerRebalanceListener rebalanceListener; + RebalanceListener rebalanceListener; @Autowired RecordHandler recordHandler; -- 2.20.1