An In-Depth Look at Spring WebFlux
When dealing with large amount of concurrent users, Traditional Spring MVC based applications tend to use a high number of threads and consume a lot of resources. Servlet 3.1 did brought in Non-blocking IO (NIO) support on top of Servlet 3.0, however, using it requires a deviation from from the rest of the Servlet API where contracts are synchronous (Servlet, Filter)or blocking (getParameter, getPart).
Adding to that, the introduction of frameworks establishing a fully non blocking contract on HTTP layer (such as Netty ) served as a starting point for developing an alternative to Spring Web Stack.
Spring WebFlux -Introduction
Spring WebFlux was introduced in Spring 5 as a new reactive fully non-blocking framework. It internally uses Reactor project, thus, supports Reactive Streams Specification and runs on such servers as Netty.
In this episode, we will go through Spring WebFlux features, in particular functional endpoints, its core components and processing in depth. I highly recommend reading Visiting Reactor Netty , it would make the learning easier as Spring WebFlux default’s embedded server is Reactor Netty.
Also, a basic understanding of Spring MVC would be a plus.