From: Kai Moritz Date: Wed, 25 Jan 2023 17:40:24 +0000 (+0100) Subject: WIP:refactor X-Git-Tag: wip~13 X-Git-Url: http://juplo.de/gitweb/?a=commitdiff_plain;h=6c22669f67a2c77490478b9a65d262e8038f7ede;p=demos%2Fkafka%2Fchat WIP:refactor --- diff --git a/src/main/java/de/juplo/kafka/chat/backend/domain/ChatRoom.java b/src/main/java/de/juplo/kafka/chat/backend/domain/ChatRoom.java index be22b1cf..878d7888 100644 --- a/src/main/java/de/juplo/kafka/chat/backend/domain/ChatRoom.java +++ b/src/main/java/de/juplo/kafka/chat/backend/domain/ChatRoom.java @@ -66,7 +66,7 @@ public class ChatRoom Message.MessageKey key = Message.MessageKey.of(user, id); - Mono other = service + Mono other = Mono.defer(() -> service .persistMessage(key, LocalDateTime.now(clock), text) .doOnNext(m -> { @@ -75,7 +75,7 @@ public class ChatRoom { log.warn("Emitting of message failed with {} for {}", result.name(), m); } - }); + })); Mono mono = service .getMessage(key)