projects
/
demos
/
kafka
/
chat
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
306eca9
)
WIP:refactor
author
Kai Moritz
<kai@juplo.de>
Wed, 25 Jan 2023 16:45:59 +0000
(17:45 +0100)
committer
Kai Moritz
<kai@juplo.de>
Wed, 25 Jan 2023 16:46:59 +0000
(17:46 +0100)
src/main/java/de/juplo/kafka/chat/backend/domain/ChatRoom.java
patch
|
blob
|
history
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
f5e3b06
..
a42434b
100644
(file)
--- a/
src/main/java/de/juplo/kafka/chat/backend/domain/ChatRoom.java
+++ b/
src/main/java/de/juplo/kafka/chat/backend/domain/ChatRoom.java
@@
-70,7
+70,7
@@
public class ChatRoom
.flatMap(existing -> text.equals(existing.getMessageText())
? Mono.just(existing)
: Mono.error(() -> new MessageMutationException(existing, text)))
- .
switchIfEmpty
(
+ .
onErrorReturn
(
service
.persistMessage(key, LocalDateTime.now(clock), text)
.doOnNext(m ->
@@
-80,7
+80,7
@@
public class ChatRoom
{
log.warn("Emitting of message failed with {} for {}", result.name(), m);
}
- }));
+ })
.block()
);
}