How to Return Flux as response when using Spring Reactor and Spring Boot?

Viewed 4523

I am trying to use Spring Reactor with my Spring Boot application.

I am using Project Reactor 3.0.7.RELEASE and Spring Boot 1.5.3.RELEASE.

I have a method in my Service class which returns Flux.

I want to return the value to controller in web layer. But, I do not see the values returns in the json response.

When I invoke http://localhost:8080 from browser, I get response as, {"prefetch":-1}

I am not sure if I should I do some conversion from Flux to String before returning the response.

I have my code shared in , https://github.com/bsridhar123/spring-reactor-demo/blob/master/src/main/java/com/demo/reactor/ReactiveApp.java

Can you please help me on the correct approach for it.

1 Answers
Related