From: Kai Moritz Date: Fri, 18 Aug 2023 12:47:20 +0000 (+0200) Subject: NG X-Git-Tag: rebase--2023-08-18-abends~13 X-Git-Url: http://juplo.de/gitweb/?a=commitdiff_plain;h=199f10e71fbb759b64d285229dc6cca1ebc43f1b;p=demos%2Fkafka%2Fchat NG --- diff --git a/src/main/java/de/juplo/kafka/chat/backend/domain/ChatRoomInfo.java b/src/main/java/de/juplo/kafka/chat/backend/domain/ChatRoomInfo.java index 6d88be95..a739e9fa 100644 --- a/src/main/java/de/juplo/kafka/chat/backend/domain/ChatRoomInfo.java +++ b/src/main/java/de/juplo/kafka/chat/backend/domain/ChatRoomInfo.java @@ -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 diff --git a/src/main/java/de/juplo/kafka/chat/backend/persistence/kafka/ChatMessageChannel.java b/src/main/java/de/juplo/kafka/chat/backend/persistence/kafka/ChatMessageChannel.java index 94f6fa6b..1abfc7f0 100644 --- a/src/main/java/de/juplo/kafka/chat/backend/persistence/kafka/ChatMessageChannel.java +++ b/src/main/java/de/juplo/kafka/chat/backend/persistence/kafka/ChatMessageChannel.java @@ -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[] chatrooms; + private final Map[] 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();