NEU vs. NG ??
[demos/kafka/chat] / src / main / java / de / juplo / kafka / chat / backend / persistence / kafka / ChatMessageChannel.java
index 084986c..138d9a7 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);
   }
 
@@ -213,7 +216,7 @@ public class ChatMessageChannel implements Runnable, ConsumerRebalanceListener
       ChatRoom chatRoom = chatrooms[record.partition()].get(chatRoomId);
       if (chatRoom == null)
       {
-        // Alles pausieren und erst von putChatRoom wieder resumen lassen!
+        // TODO: Alles pausieren und erst von putChatRoom wieder resumen lassen!
       }
       KafkaChatRoomService kafkaChatRoomService =
           (KafkaChatRoomService) chatRoom.getChatRoomService();