writeChatRoomData(
chatRoomId,
messageFlux,
- (id) -> log.info("Successfully stored chat-room {}", id),
- (id, throwable) -> log.error("Could not store chat-room {}: {}", id, throwable));
+ (id) -> logSuccess(id),
+ (id, throwable) -> logFailure(id, throwable));
}
void writeChatRoomInfo(Flux<ChatRoomInfo> chatRoomInfoFlux);
interface SuccessCallback extends Consumer<UUID> {}
interface FailureCallback extends BiConsumer<UUID, Throwable> {}
+
+ default void logSuccess(UUID chatRoomId)
+ {
+ log.info("Successfully stored chat-room {}", chatRoomId);
+ }
+
+ default void logFailure(UUID chatRoomId, Throwable throwable)
+ {
+ log.error("Could not store chat-room {}: {}", chatRoomId, throwable);
+ }
}