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

index d319295..63d57df 100644 (file)
@@ -10,7 +10,7 @@ import java.util.*;
 
 @RequiredArgsConstructor
 @Slf4j
-public class ApplicationRebalanceListener implements CommittingConsumerRebalanceListener
+public class ApplicationRebalanceListener implements RebalanceListener
 {
   private final ApplicationRecordHandler recordHandler;
   private final AdderResults adderResults;
diff --git a/src/main/java/de/juplo/kafka/CommittingConsumerRebalanceListener.java b/src/main/java/de/juplo/kafka/CommittingConsumerRebalanceListener.java
deleted file mode 100644 (file)
index 8aa92c0..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-package de.juplo.kafka;
-
-import org.apache.kafka.clients.consumer.ConsumerRebalanceListener;
-
-
-public interface CommittingConsumerRebalanceListener extends ConsumerRebalanceListener
-{
-  void enableCommits();
-  void disableCommits();
-}
index 63fc10f..3ff479c 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 CommittingConsumerRebalanceListener 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/RebalanceListener.java b/src/main/java/de/juplo/kafka/RebalanceListener.java
new file mode 100644 (file)
index 0000000..26f97aa
--- /dev/null
@@ -0,0 +1,10 @@
+package de.juplo.kafka;
+
+import org.apache.kafka.clients.consumer.ConsumerRebalanceListener;
+
+
+public interface RebalanceListener extends ConsumerRebalanceListener
+{
+  void enableCommits();
+  void disableCommits();
+}
index 7335770..8124c81 100644 (file)
@@ -66,7 +66,7 @@ abstract class GenericApplicationTests<K, V>
        @Autowired
        MongoProperties mongoProperties;
        @Autowired
-       CommittingConsumerRebalanceListener rebalanceListener;
+       RebalanceListener rebalanceListener;
        @Autowired
        RecordHandler<K, V> recordHandler;