From: Kai Moritz Date: Sun, 18 Feb 2024 18:09:00 +0000 (+0100) Subject: WIP:mongodb map vs subscribe X-Git-Tag: rebase--2024-02-19--08-59~5 X-Git-Url: http://juplo.de/gitweb/?a=commitdiff_plain;h=0352682b34137bf6eab400c6f5fe97caa26cd81c;p=demos%2Fkafka%2Fchat WIP:mongodb map vs subscribe --- diff --git a/src/main/java/de/juplo/kafka/chat/backend/storage/mongodb/MongoDbStorageStrategy.java b/src/main/java/de/juplo/kafka/chat/backend/storage/mongodb/MongoDbStorageStrategy.java index 16bde247..780d64be 100644 --- a/src/main/java/de/juplo/kafka/chat/backend/storage/mongodb/MongoDbStorageStrategy.java +++ b/src/main/java/de/juplo/kafka/chat/backend/storage/mongodb/MongoDbStorageStrategy.java @@ -25,7 +25,7 @@ public class MongoDbStorageStrategy implements StorageStrategy { chatRoomInfoFlux .map(ChatRoomTo::from) - .flatMap(chatroomTo -> chatRoomRepository.save(chatroomTo)) + .map(chatroomTo -> chatRoomRepository.save(chatroomTo)) .subscribe(); } @@ -46,7 +46,7 @@ public class MongoDbStorageStrategy implements StorageStrategy { messageFlux .map(message -> MessageTo.from(chatRoomId, message)) - .flatMap(messageTo -> messageRepository.save(messageTo)) + .map(messageTo -> messageRepository.save(messageTo)) .subscribe(); }