How to do it...

Let us implement reactive services using HandlerFunction<T> and RouterFunction<T>. Follow these steps:

  1. Before anything else, implementing a functional web framework means there will be a need to set up and configure another reactive embedded server that will execute and run these independent services. Since the embedded Tomcat is the one running for the whole Spring Boot 2.0 application, it will be advisable if Netty, Jetty, or Undertow were used to listen and run these independent services. This recipe chose the Reactor Netty server as the dedicated server for these functional-based events. Thus, now include the Netty APIs from the webflux starter POM:
<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-webflux</artifactId> ...

Get Spring 5.0 Cookbook now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.