From: Kai Moritz Date: Fri, 15 Sep 2023 19:27:20 +0000 (+0200) Subject: FIX X-Git-Tag: rebase--2023-09-15--21-27 X-Git-Url: http://juplo.de/gitweb/?a=commitdiff_plain;h=98d8397a8b43d238007aea2e55f1bf4c98bf7689;p=demos%2Fkafka%2Fchat FIX --- diff --git a/src/main/java/de/juplo/kafka/chat/backend/implementation/kafka/DataChannel.java b/src/main/java/de/juplo/kafka/chat/backend/implementation/kafka/DataChannel.java index de681945..d2d6f300 100644 --- a/src/main/java/de/juplo/kafka/chat/backend/implementation/kafka/DataChannel.java +++ b/src/main/java/de/juplo/kafka/chat/backend/implementation/kafka/DataChannel.java @@ -298,16 +298,13 @@ public class DataChannel implements Runnable, ConsumerRebalanceListener return infoChannel .getChatRoomInfo(id) - .map(chatRoomInfo -> - chatRoomInfo == null - ? null - : chatRoomData[shard].computeIfAbsent( - id, - (chatRoomId) -> - { - log.info("Creating ChatRoom {} with buffer-size {}", chatRoomId, bufferSize); - KafkaChatMessageService service = new KafkaChatMessageService(this, chatRoomId); - return new ChatRoomData(clock, service, bufferSize); - })); + .map(chatRoomInfo -> chatRoomData[shard].computeIfAbsent( + id, + (chatRoomId) -> + { + log.info("Creating ChatRoom {} with buffer-size {}", chatRoomId, bufferSize); + KafkaChatMessageService service = new KafkaChatMessageService(this, chatRoomId); + return new ChatRoomData(clock, service, bufferSize); + })); } }