From 0352682b34137bf6eab400c6f5fe97caa26cd81c Mon Sep 17 00:00:00 2001 From: Kai Moritz Date: Sun, 18 Feb 2024 19:09:00 +0100 Subject: [PATCH] WIP:mongodb map vs subscribe --- .../chat/backend/storage/mongodb/MongoDbStorageStrategy.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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(); } -- 2.20.1