introduce

Those who are good at English are advised to read the official documents directly.

Spring WebFlux is a new responsive Web Framework introduced in Spring Framework 5.0. Unlike Spring MVC, it does not require a Servlet API, is fully asynchronous and non-blocking, and implements the Reactive Streams specification through the Reactor project. Spring WebFlux is used to create completely asynchronous and non-blocking applications based on the event loop execution model.

Reactive Streams is a set of specifications for building high-throughput, low-latency applications. The Reactor project is based on the implementation of this specification, which is a completely non-blocking foundation that supports back pressure. Spring WebFlux is a responsive stack that implements a fully asynchronous, non-blocking web framework based on Reactor.

【 Spring-webmvc + Servlet + Tomcat】 imperative, synchronous blocking

Spring – WebFlux + Reactor + Netty

Spring MVC or WebFlux?

The official website gives a picture and we need to consider the selection of some suggestions

Personal understanding mainly depends on the specific business scenarios and the internal technology stack of our own R&D team, because most of the scenarios are blocking mode, and we have been accustomed to this mode, so we need to consider the cost of switching to responsive programming learning.

Spring WebFlux Framework

Let’s write a simple application to try it out. We can create a new WebFlux application directly in Idea.

Spring WebFlux comes in two styles: functional and annotation-based. Annotation based is very similar to Spring MVC

Start the application and access it directly in the browser, or relatively easy

The last

Well, this article is introduced here, and then some of its core principles and features will be introduced in detail. IO /projects/sp…