Developing non-blocking synchronous REST APIs
In this section, we will learn how to develop non-blocking versions of the read APIs. The composite service will make reactive, that is, non-blocking, calls in parallel to the three core services. When the composite service has received responses from all of the core services, it will create a composite response and send it back to the caller. This is illustrated in the following diagram:
In this section, we will cover the following:
- An introduction to Project Reactor
- Non-blocking persistence using Spring Data for MongoDB
- Non-blocking REST APIs in the core services, including how to handle blocking code for the JPA-based persistence layer
- Non-blocking REST APIs in the composite service
An introduction to Project Reactor
As we mentioned in the Spring WebFlux section in Chapter 2, Introduction to Spring Boot, the reactive support in Spring 5 is based on Project Reactor (https://projectreactor...