Using Mono<T> and Flux<T> publishers for services
Although Spring Functional and Reactive Framework will be discussed thoroughly in the next chapter, this recipe will provide evidence that Spring 5 MVC has a full support on Reactor Core 3.x's Mono<T>
and Flux<T>
stream operations. This recipe will ex how to start and build Spring WebFlux applications from the ground up using the Spring 5 platform.
Getting started
Open project ch08
again and add some @Service
non-blocking methods that retrieve employee data from a data source using Flux<T>
and Mono<T>
, manipulate them, apply backpressure to stream operations, and utilize multithreading through Reactor's Scheduler.
How to do it...
In the previous chapters, we have provided details about Mono<T>
and Flux<T>
streams and how they behave when executed using test methods. This time, let us apply the following streams in our asynchronous and reactive services by following these steps:
- Before we start, add...