messages = new LinkedHashMap<>();
messageFlux
.doOnNext(message -> messages.put(message.getKey(), message))
- .then()
- .doOnSuccess(empty -> log.info("Restored InMemoryChatMessageService"))
+ .count()
+ .doOnSuccess(count -> log.info("Restored InMemoryChatMessageService with {} messages", count))
.doOnError(throwable -> log.error("Could not restore InMemoryChatMessageService"))
.block();
}
new InMemoryChatMessageService(messageFlux),
bufferSize));
})
- .then()
- .doOnSuccess(empty -> log.info("Restored {}", this))
+ .count()
+ .doOnSuccess(count -> log.info("Restored {} with {} chat-rooms", this, count))
.doOnError(throwable -> log.error("Could not restore {}", this))
.block();