NG
authorKai Moritz <kai@juplo.de>
Fri, 18 Aug 2023 12:47:20 +0000 (14:47 +0200)
committerKai Moritz <kai@juplo.de>
Fri, 18 Aug 2023 15:18:41 +0000 (17:18 +0200)
src/main/java/de/juplo/kafka/chat/backend/domain/ChatRoomInfo.java
src/main/java/de/juplo/kafka/chat/backend/persistence/kafka/ChatMessageChannel.java

index 6d88be9..a739e9f 100644 (file)
@@ -8,7 +8,7 @@ import lombok.ToString;
 import java.util.UUID;
 
 
-@RequiredArgsConstructor
+@RequiredArgsConstructor(staticName = "of")
 @EqualsAndHashCode(of = { "id" })
 @ToString(of = { "id", "name", "shard" })
 public class ChatRoomInfo
index 94f6fa6..1abfc7f 100644 (file)
@@ -34,7 +34,7 @@ public class ChatMessageChannel implements Runnable, ConsumerRebalanceListener
   private final boolean[] isShardOwned;
   private final long[] currentOffset;
   private final long[] nextOffset;
-  private final Map<UUID, ChatRoom>[] chatrooms;
+  private final Map<UUID, ChatRoomInfo>[] chatrooms;
 
   private boolean running;
   @Getter
@@ -308,7 +308,7 @@ public class ChatMessageChannel implements Runnable, ConsumerRebalanceListener
     Message.MessageKey key = Message.MessageKey.of(chatMessageTo.getUser(), chatMessageTo.getId());
     Message message = new Message(key, offset, timestamp, chatMessageTo.getText());
 
-    ChatRoom chatRoom = chatrooms[partition].get(chatRoomId);
+    ChatRoomInfo chatRoom = chatrooms[partition].get(chatRoomId);
     KafkaChatRoomService kafkaChatRoomService =
         (KafkaChatRoomService) chatRoom.getChatRoomService();
 
@@ -333,7 +333,7 @@ public class ChatMessageChannel implements Runnable, ConsumerRebalanceListener
   }
 
 
-  private void putChatRoom(ChatRoom chatRoom)
+  private void putChatRoom(ChatRoomInfo chatRoom)
   {
     Integer partition = chatRoom.getShard();
     UUID chatRoomId = chatRoom.getId();