@Override
public void writeChatRoomData(
UUID chatRoomId,
- Flux<Message> messageFlux,
- SuccessCallback successCallback,
- FailureCallback failureCallback)
+ Flux<Message> messageFlux)
{
Path path = chatroomPath(chatRoomId);
log.info("Writing messages for {} to {}", chatRoomId, path);
throw new RuntimeException(e);
}
});
-
- successCallback.accept(chatRoomId);
}
catch (IOException e)
{
- failureCallback.accept(chatRoomId, e);
+ throw new RuntimeException(e);
}
}
}
@Override
- public void writeChatRoomData(
- UUID chatRoomId,
- Flux<Message> messageFlux,
- SuccessCallback successCallback,
- FailureCallback failureCallback)
+ public void writeChatRoomData(UUID chatRoomId, Flux<Message> messageFlux)
{
messageFlux
.map(message -> MessageTo.from(chatRoomId, message))
- .doOnComplete(() -> successCallback.accept(chatRoomId))
- .doOnError(throwable -> failureCallback.accept(chatRoomId, throwable))
.subscribe(messageTo -> messageRepository.save(messageTo));
}
}
@Override
- public void writeChatRoomData(
- UUID chatRoomId,
- Flux<Message> messageFlux,
- SuccessCallback successCallback,
- FailureCallback failureCallback
- )
- {
- successCallback.accept(chatRoomId);
- }
+ public void writeChatRoomData(UUID chatRoomId, Flux<Message> messageFlux) {}
@Override
public Flux<Message> readChatRoomData(UUID chatRoomId)