package de.juplo.kafka.chat.backend.domain;
-import java.util.concurrent.atomic.AtomicInteger;
-
-
public class LoadInProgressException extends IllegalStateException
{
- static AtomicInteger counter = new AtomicInteger();
-
public LoadInProgressException()
{
- super("Load in progress... " + counter.incrementAndGet());
+ super("Load in progress...");
}
}
{
if (loadInProgress)
{
- log.error("Load in progress!");
return Mono.error(new LoadInProgressException());
}
if (!isShardOwned[shard])
{
- log.error("Shard {} for chat-room {} not owned!", shard, id);
return Mono.error(new ShardNotOwnedException(shard));
}
int shard = selectShard(id);
return chatRoomChannel
.getChatRoom(shard, id)
- .switchIfEmpty(Mono.error(() -> {
- log.error("Unknown chat-room {} (shard={})!", id, shard);
- return new UnknownChatroomException(
- id,
- shard,
- chatRoomChannel.getOwnedShards());
- }));
+ .switchIfEmpty(Mono.error(() -> new UnknownChatroomException(
+ id,
+ shard,
+ chatRoomChannel.getOwnedShards())));
}
int selectShard(UUID chatRoomId)
logging:
level:
root: INFO
- de.juplo.kafka.chat.backend: TRACE
+ de.juplo.kafka.chat.backend: DEBUG