July 2018
Intermediate to advanced
268 pages
7h 36m
English
Spring Webflux supports a number of servers, as follows:
Spring Boot 2+ uses Netty by default, when the web application framework selected is Spring WebFlux.
The RouterFunction created can be run on any of the servers listed previously. To do that, RouterFunction needs to be converted to HttpHandler, using the following method:
RouterFunctions.toHttpHandler(RouterFunction)
If you want to run the previously created RouterFunction in Netty, the following code snippet can be used:
HttpHandler httpHandler = RouterFunctions.toHttpHandler(movieRoutes);ReactorHttpHandlerAdapter reactorAdapter = new ReactorHttpHandlerAdapter(httpHandler);HttpServer server = HttpServer.create(HOST, ...
Read now
Unlock full access