- The method `InfoChannel.getChatRoomInfo(UUID)` has to check, if loading
is in process.
- Otherwise, an existing chat-room might erronously not be found, if it is
requested, while `InfoChannel` is loading, because it is not yet loaded.
package de.juplo.kafka.chat.backend.implementation.kafka;
import de.juplo.kafka.chat.backend.domain.ChatRoomInfo;
+import de.juplo.kafka.chat.backend.domain.exceptions.LoadInProgressException;
import de.juplo.kafka.chat.backend.implementation.kafka.messages.AbstractMessageTo;
import de.juplo.kafka.chat.backend.implementation.kafka.messages.info.EventChatRoomCreated;
import de.juplo.kafka.chat.backend.implementation.kafka.messages.info.EventShardAssigned;
Mono<ChatRoomInfo> getChatRoomInfo(UUID id)
{
+ if (loadInProgress)
+ {
+ return Mono.error(new LoadInProgressException());
+ }
+
return Mono.fromSupplier(() -> chatRoomInfo.get(id));
}