public interface ChatHomeService
{
Mono<ChatRoom> getChatRoom(int shard, UUID id);
- Flux<ChatRoom> getChatRooms(int shard);
+ Flux<ChatRoomInfo> getChatRooms(int shard);
}
}
@Override
- public Flux<ChatRoom> getChatRooms()
+ public Flux<ChatRoomInfo> getChatRooms()
{
return Flux
.fromIterable(ownedShards)
}
@Override
- public Flux<ChatRoom> getChatRooms()
+ public Flux<ChatRoomInfo> getChatRooms()
{
return service.getChatRooms(shard);
}
import de.juplo.kafka.chat.backend.domain.ChatRoom;
import de.juplo.kafka.chat.backend.domain.ChatHomeService;
+import de.juplo.kafka.chat.backend.domain.ChatRoomInfo;
import lombok.extern.slf4j.Slf4j;
import reactor.core.publisher.Flux;
import reactor.core.publisher.Mono;
}
@Override
- public Flux<ChatRoom> getChatRooms(int shard)
+ public Flux<ChatRoomInfo> getChatRooms(int shard)
{
return Flux.fromStream(chatrooms[shard].values().stream());
}
import de.juplo.kafka.chat.backend.domain.ChatHome;
import de.juplo.kafka.chat.backend.domain.ChatRoom;
+import de.juplo.kafka.chat.backend.domain.ChatRoomInfo;
import de.juplo.kafka.chat.backend.domain.ShardingStrategy;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;