How it works...

In the previous recipe, the spring-boot-starter-reactor-netty has been excluded from the POM dependencies just to avoid confusion on what embedded server to use for the standalone execution. At this point, Reactor Netty server must be included in order to listen and run these threaded and functional web components of Spring 5, namely the HandlerFunction<?> and RouterFunction<?>.

It requires having a webflux@configuration class in order to implement these components. Syntax errors will arise if we apply @Controller to the class, since RouterFunction<?> and HandlerFunction<?> together take the role of the @Controller and @RequestMapping in a typical MVC scenario. In a functional web model, RouterFunction is implemented to

Get Spring 5.0 Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.