NEU
authorKai Moritz <kai@juplo.de>
Thu, 20 Apr 2023 20:11:51 +0000 (22:11 +0200)
committerKai Moritz <kai@juplo.de>
Fri, 21 Apr 2023 08:27:51 +0000 (10:27 +0200)
src/main/java/de/juplo/kafka/chat/backend/persistence/kafka/ChatMessageChannel.java

index 084986c..ac30f1d 100644 (file)
@@ -60,6 +60,9 @@ public class ChatMessageChannel implements Runnable, ConsumerRebalanceListener
     this.currentOffset = new long[numShards];
     this.nextOffset = new long[numShards];
     this.chatrooms = new Map[numShards];
+    IntStream
+        .range(0, numShards)
+        .forEach(shard -> this.chatrooms[shard] = new HashMap<>());
     this.shardingStrategy = new KafkaLikeShardingStrategy(numShards);
   }