Using Spring Web Flux for the REST controller
Controllers are the integration point between the model and resources in an Application. They act like the glue that binds everything together while taking care of business logic execution and response. The following Maven starter dependency
needs to be added to enable Spring WebFlux:
<dependencies> ... <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-webflux</artifactId> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-tomcat</artifactId> </dependency> </dependencies>
The preceding dependency
will import Asynchronous Servlets, Spring, and Tomcat dependencies to enable the successful writing of reactive web applications using Spring.
Implementing controllers
The following code is for TweetController
, which caters for retrieving and...