Wechsel auf den `StickyAssignor` löst die Rebalance-Fehler
[demos/kafka/training] / src / main / java / de / juplo / kafka / ApplicationConfiguration.java
index 4d056c4..624a4ec 100644 (file)
@@ -6,7 +6,6 @@ import org.springframework.boot.context.properties.EnableConfigurationProperties
 import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.Configuration;
 
-import java.time.Clock;
 import java.util.Optional;
 import java.util.Properties;
 import java.util.concurrent.ExecutorService;
@@ -24,7 +23,8 @@ public class ApplicationConfiguration
   {
     return new ApplicationRecordHandler(
         adderResults,
-        Optional.ofNullable(properties.getThrottle()));
+        Optional.ofNullable(properties.getThrottle()),
+        properties.getClientId());
   }
 
   @Bean
@@ -77,7 +77,7 @@ public class ApplicationConfiguration
     Properties props = new Properties();
 
     props.put("bootstrap.servers", properties.getBootstrapServer());
-    props.put("partition.assignment.strategy", "org.apache.kafka.clients.consumer.CooperativeStickyAssignor");
+    props.put("partition.assignment.strategy", "org.apache.kafka.clients.consumer.StickyAssignor");
     props.put("group.id", properties.getGroupId());
     props.put("client.id", properties.getClientId());
     props.put("auto.offset.reset", properties.getAutoOffsetReset());