From: Kai Moritz Date: Fri, 15 Sep 2023 18:58:52 +0000 (+0200) Subject: FIX X-Git-Tag: rebase--2023-09-15--21-27~1 X-Git-Url: http://juplo.de/gitweb/?a=commitdiff_plain;h=313a1ff6a5a6a3ce2c9718a8f71965c441c937f7;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 e42ea9f2..de681945 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 @@ -299,16 +299,15 @@ public class DataChannel implements Runnable, ConsumerRebalanceListener return infoChannel .getChatRoomInfo(id) .map(chatRoomInfo -> - { - if (chatRoomInfo == null) return null; - return 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); - }); - }); + 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); + })); } }