Benennung vereinheitlicht und projektunabhängig gemacht
[demos/kafka/training] / src / main / java / de / juplo / kafka / ApplicationConfiguration.java
index 7a0a8ad..bf00b6d 100644 (file)
@@ -17,27 +17,16 @@ import java.util.concurrent.Executors;
 public class ApplicationConfiguration
 {
   @Bean
-  public KeyCountingRecordHandler keyCountingRecordHandler()
+  public ApplicationRecordHandler recordHandler()
   {
-    return new KeyCountingRecordHandler();
-  }
-
-  @Bean
-  public KeyCountingRebalanceListener keyCountingRebalanceListener(
-      KeyCountingRecordHandler keyCountingRecordHandler,
-      ApplicationProperties properties)
-  {
-    return new KeyCountingRebalanceListener(
-        keyCountingRecordHandler,
-        properties.getClientId());
+    return new ApplicationRecordHandler();
   }
 
   @Bean
   public EndlessConsumer<String, Long> endlessConsumer(
       KafkaConsumer<String, Long> kafkaConsumer,
       ExecutorService executor,
-      KeyCountingRebalanceListener keyCountingRebalanceListener,
-      KeyCountingRecordHandler keyCountingRecordHandler,
+      ApplicationRecordHandler recordHandler,
       ApplicationProperties properties)
   {
     return
@@ -46,8 +35,7 @@ public class ApplicationConfiguration
             properties.getClientId(),
             properties.getTopic(),
             kafkaConsumer,
-            keyCountingRebalanceListener,
-            keyCountingRecordHandler);
+            recordHandler);
   }
 
   @Bean