I have the following code:
public Flux<Foo> getFoos(String xyz) {
return getBar(xyz).flatMap(b -> Flux.empty()));
}
But it results in a compilation error because getBars()
returns a Mono<Bar>
instead of a Flux<Bar>
. How can I return a Flux from a flatMap()
of a Mono value? Thanks.
Found the solution. I just had to use flatMapMany()
instead of flatMap()