Funktionsunabhängiger Name für das erweiterte Interface RebalanceListener
authorKai Moritz <kai@juplo.de>
Fri, 2 Sep 2022 03:18:23 +0000 (05:18 +0200)
committerKai Moritz <kai@juplo.de>
Fri, 2 Sep 2022 03:30:31 +0000 (05:30 +0200)
src/main/java/de/juplo/kafka/ApplicationRebalanceListener.java
src/main/java/de/juplo/kafka/EndlessConsumer.java
src/main/java/de/juplo/kafka/PollIntervalAwareConsumerRebalanceListener.java [deleted file]
src/main/java/de/juplo/kafka/RebalanceListener.java [new file with mode: 0644]
src/test/java/de/juplo/kafka/GenericApplicationTests.java

index b517d35..a751e75 100644 (file)
@@ -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;
index bdfb9bd..8f5eab3 100644 (file)
@@ -25,7 +25,7 @@ public class EndlessConsumer<K, V> implements Runnable
   private final String id;
   private final String topic;
   private final Consumer<K, V> consumer;
-  private final PollIntervalAwareConsumerRebalanceListener rebalanceListener;
+  private final RebalanceListener rebalanceListener;
   private final RecordHandler<K, V> 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/PollIntervalAwareConsumerRebalanceListener.java
deleted file mode 100644 (file)
index c59418c..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-package de.juplo.kafka;
-
-import org.apache.kafka.clients.consumer.ConsumerRebalanceListener;
-
-
-public interface PollIntervalAwareConsumerRebalanceListener extends ConsumerRebalanceListener
-{
-  default void beforeNextPoll() {}
-
-  default void enableCommits() {}
-  default void disableCommits() {}
-}
diff --git a/src/main/java/de/juplo/kafka/RebalanceListener.java b/src/main/java/de/juplo/kafka/RebalanceListener.java
new file mode 100644 (file)
index 0000000..497a111
--- /dev/null
@@ -0,0 +1,12 @@
+package de.juplo.kafka;
+
+import org.apache.kafka.clients.consumer.ConsumerRebalanceListener;
+
+
+public interface RebalanceListener extends ConsumerRebalanceListener
+{
+  default void beforeNextPoll() {}
+
+  default void enableCommits() {}
+  default void disableCommits() {}
+}
index ff4a318..a8fa7ea 100644 (file)
@@ -68,7 +68,7 @@ abstract class GenericApplicationTests<K, V>
        @Autowired
        MongoProperties mongoProperties;
        @Autowired
-       PollIntervalAwareConsumerRebalanceListener rebalanceListener;
+       RebalanceListener rebalanceListener;
        @Autowired
        RecordHandler<K, V> recordHandler;