From: Kai Moritz Date: Fri, 24 Feb 2023 10:57:01 +0000 (+0100) Subject: WIP X-Git-Tag: wip-sharding~4 X-Git-Url: http://juplo.de/gitweb/?a=commitdiff_plain;h=44c38412cf209538b6613785baf73a51cb90f98d;p=demos%2Fkafka%2Fchat WIP --- diff --git a/src/main/java/de/juplo/kafka/chat/backend/api/ChatBackendController.java b/src/main/java/de/juplo/kafka/chat/backend/api/ChatBackendController.java index 482e1f96..2c54afd7 100644 --- a/src/main/java/de/juplo/kafka/chat/backend/api/ChatBackendController.java +++ b/src/main/java/de/juplo/kafka/chat/backend/api/ChatBackendController.java @@ -10,7 +10,6 @@ import org.springframework.web.bind.annotation.*; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; -import java.util.Arrays; import java.util.UUID; @@ -21,7 +20,6 @@ public class ChatBackendController private final ChatHome chatHome; private final ChatRoomFactory factory; private final StorageStrategy storageStrategy; - private final int[] ownedShards; @PostMapping("create") @@ -34,11 +32,11 @@ public class ChatBackendController } - @GetMapping("list/{shard}") - public Flux list(@PathVariable int shard) + @GetMapping("list") + public Flux list() { return chatHome - .getChatRooms(shard) + .getChatRooms() .map(chatroom -> ChatRoomInfoTo.from(chatroom)); } @@ -136,8 +134,6 @@ public class ChatBackendController @PostMapping("/store") public void store() { - Arrays - .stream(ownedShards) - .forEach(i -> storageStrategy.write(chatHome.getChatRooms(i))); // TODO: Sharded Storage + storageStrategy.write(chatHome.getChatRooms()); } }