What ist better to create a fully non-blocking REST-Service?
Mono<T> findById(ID id);
or
Mono<T> findById(Publisher<ID> id);
Is the second method less blocking?
Here is an example:
@GetMapping
public Mono<UserProfile> getUserProfile(Mono<Authentication> authentication) {
return reactiveUserProfileRepository.findById(
authentication.map(auth -> auth.getName()));
}
Or is it good enough to use an object as parameter?
public Mono<UserProfile> getUserProfile(Authentication authentication) {
...