+ this.chatrooms = new HashMap<>();
+ chatroomFlux
+ .filter(chatRoom ->
+ {
+ if (shard > -1 && chatRoom.getShard() == shard)
+ {
+ return true;
+ }
+ else
+ {
+ log.info(
+ "SimpleChatHome for shard {} ignores not owned chat-room {}",
+ shard,
+ chatRoom);
+ return false;
+ }
+ })
+ .toStream()
+ .forEach(chatroom -> chatrooms.put(chatroom.getId(), chatroom));
+ this.shard = shard;