From: Kai Moritz Date: Tue, 10 Jan 2023 20:30:45 +0000 (+0100) Subject: TEST X-Git-Tag: TEST X-Git-Url: http://juplo.de/gitweb/?a=commitdiff_plain;h=2f332a4301df186f11f20679caa95c15a6ff93c2;p=demos%2Fkafka%2Fchat TEST --- diff --git a/src/main/java/de/juplo/kafka/chat/backend/persistence/storage/mongodb/ChatRoomTo.java b/src/main/java/de/juplo/kafka/chat/backend/persistence/storage/mongodb/ChatRoomTo.java index bc3863b3..73b0d457 100644 --- a/src/main/java/de/juplo/kafka/chat/backend/persistence/storage/mongodb/ChatRoomTo.java +++ b/src/main/java/de/juplo/kafka/chat/backend/persistence/storage/mongodb/ChatRoomTo.java @@ -21,18 +21,11 @@ public class ChatRoomTo @Id private String id; private String name; - @DBRef - private List messages; public static ChatRoomTo from(ChatRoom chatroom) { return new ChatRoomTo( chatroom.getId().toString(), - chatroom.getName(), - chatroom - .getMessages() - .map(MessageTo::from) - .collectList() - .block()); + chatroom.getName()); } } diff --git a/src/main/java/de/juplo/kafka/chat/backend/persistence/storage/mongodb/MongoDbStorageStrategy.java b/src/main/java/de/juplo/kafka/chat/backend/persistence/storage/mongodb/MongoDbStorageStrategy.java index 8cbbb556..3f4ba506 100644 --- a/src/main/java/de/juplo/kafka/chat/backend/persistence/storage/mongodb/MongoDbStorageStrategy.java +++ b/src/main/java/de/juplo/kafka/chat/backend/persistence/storage/mongodb/MongoDbStorageStrategy.java @@ -42,9 +42,7 @@ public class MongoDbStorageStrategy implements StorageStrategy chatRoomTo.getName(), clock, factory.create( - Flux - .fromIterable(chatRoomTo.getMessages()) - .map(messageTo -> messageTo.toMessage())), + Flux.empty()), bufferSize)); } }