{
chatRoomInfoFlux
.map(ChatRoomTo::from)
- .subscribe(chatroomTo -> chatRoomRepository.save(chatroomTo));
+ .flatMap(chatroomTo -> chatRoomRepository.save(chatroomTo))
+ .subscribe();
}
@Override
{
messageFlux
.map(message -> MessageTo.from(chatRoomId, message))
+ .flatMap(messageTo -> messageRepository.save(messageTo))
.doOnComplete(() -> successCallback.accept(chatRoomId))
.doOnError(throwable -> failureCallback.accept(chatRoomId, throwable))
- .subscribe(messageTo -> messageRepository.save(messageTo));
+ .subscribe();
}
@Override