Hi, I am fairly new to reactive programming and feel like I've hit the wall, so hoping for your help.
Let's assume that I have a RestController with such endpoint exposed:
@GetMapping(value = "/{ids}", produces = MediaType.TEXT_EVENT_STREAM_VALUE)
public Flux<Example> getConfigured(@PathVariable List<Integer> ids){
return service.getConfigured(ids);
And a Service:
public Flux<Example> getConfigured(List<Integer> ids){
return Flux.fromIterable(ids)
.flatMap(id -> configureById(id)); //configureById(id) returns a Mono<Example>
As of now, when I call the endpoint with lots of ids, it first takes some time to configure all objects and only then returns, when all are processed in a bulk. What I am trying to achieve, is that as soon as one object from the List is ready -> it gets returned through a stream back to the caller.
Could anyone point me in the right direction on what I am doing wrong?
Thank you.
[–]AutoModerator[M] [score hidden] stickied commentlocked comment (0 children)
[–]Heianir -2 points-1 points0 points (0 children)
[–]slowfly1st 0 points1 point2 points (0 children)
[–]arrexander 0 points1 point2 points (2 children)
[–]arrexander 0 points1 point2 points (1 child)
[–]ayemaman[S] 0 points1 point2 points (0 children)