When to use Mono<List<Object>> and when Flux<Object> for RestController method When to use Mono<List<Object>> and when Flux<Object> for RestController method spring spring

When to use Mono<List<Object>> and when Flux<Object> for RestController method


Flux<Object> indicates that new Object instances can be pushed in a reactive way at any point. With Mono<List<Object>>, you will get 1 time a value that is a list of objects, but that list will never change.

See also Mono vs Flux in Reactive Stream