From: Kai Moritz Date: Sun, 26 Feb 2023 13:28:47 +0000 (+0100) Subject: WIP:sharding-in-implementation X-Git-Url: http://juplo.de/gitweb/?a=commitdiff_plain;h=2f1292e34d007a826de38e1735e7b55c5864c328;p=demos%2Fkafka%2Fchat WIP:sharding-in-implementation --- diff --git a/src/main/java/de/juplo/kafka/chat/backend/persistence/kafka/KafkaChatHomeService.java b/src/main/java/de/juplo/kafka/chat/backend/persistence/kafka/KafkaChatHomeService.java index 2e3b42f6..7f36024d 100644 --- a/src/main/java/de/juplo/kafka/chat/backend/persistence/kafka/KafkaChatHomeService.java +++ b/src/main/java/de/juplo/kafka/chat/backend/persistence/kafka/KafkaChatHomeService.java @@ -124,13 +124,13 @@ public class KafkaChatHomeService implements ChatHomeService, ConsumerRebalanceL } @Override - public Mono getChatRoom(int shard, UUID id) + public Mono getChatRoom(UUID id) { return Mono.justOrEmpty(chatrooms[shard].get(id)); } @Override - public Flux getChatRooms(int shard) + public Flux getChatRooms() { return Flux.fromStream(chatrooms[shard].values().stream()); }