return messageFlux
.doOnNext(message -> messages.put(message.getKey(), message))
- .then()
- .doOnSuccess(empty -> log.info("Restored InMemoryChatMessageService"))
- .doOnError(throwable -> log.error("Could not restore InMemoryChatMessageService"));
+ .count()
+ .doOnSuccess(count -> log.info("Restored InMemoryChatMessageService with {} messages", count))
+ .doOnError(throwable -> log.error("Could not restore InMemoryChatMessageService"))
+ .then();
}
@Override
return chatMessageService.restore(storageStrategy);
})
- .then()
- .doOnSuccess(empty -> log.info("Restored {}", this))
- .doOnError(throwable -> log.error("Could not restore {}", this));
+ .count()
+ .doOnSuccess(count -> log.info("Restored {} with {} chat-rooms", this, count))
+ .doOnError(throwable -> log.error("Could not restore {}", this))
+ .then();
}