fix: Fixed a NPE in `ShardedChatHome.getChatRooms()`
[demos/kafka/chat] / src / main / java / de / juplo / kafka / chat / backend / domain / ChatRoom.java
index 3019743..cc5c5a0 100644 (file)
@@ -30,6 +30,7 @@ public class ChatRoom
   private final int bufferSize;
   private Sinks.Many<Message> sink;
 
+
   public ChatRoom(
       UUID id,
       String name,
@@ -37,11 +38,15 @@ public class ChatRoom
       ChatRoomService service,
       int bufferSize)
   {
+    log.info("Created ChatRoom {} with buffer-size {}", id, bufferSize);
     this.id = id;
     this.name = name;
     this.clock = clock;
     this.service = service;
     this.bufferSize = bufferSize;
+    // @RequiredArgsConstructor unfortunately not possible, because
+    // the `bufferSize` is not set, if `createSink()` is called
+    // from the variable declaration!
     this.sink = createSink();
   }