© Marten Deinum 2018
Marten DeinumSpring Boot 2 Recipeshttps://doi.org/10.1007/978-1-4842-3963-6_5

5. Spring WebFlux

Marten Deinum1 
(1)
Meppel, Drenthe, The Netherlands
 

5.1 Developing a Reactive Application with Spring WebFlux

Problem

You want to develop a simple reactive web application with Spring WebFlux to learn the basic concepts and configurations of this framework.

Solution

The lowest component of Spring WebFlux is the HttpHandler , an interface with a single handle method.
public interface HttpHandler {
  Mono<Void> handle(ServerHttpRequest request, ServerHttpResponse response);
}

The handle method returns a Mono<Void> , which is the reactive way of saying it returns void. It takes both a ServerHttpRequest and ServerHttpResonse from the org.springframework.http.server.reactive ...

Get Spring Boot 2 Recipes: A Problem-Solution Approach now with O’Reilly online learning.

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