Spring 5 - Getting Start with Spring WebFlux Framework



Hello Welcome to KhmerSide !

Subscribe KhmerSide

In this video, I will show how to get start with Spring 5 WebFlux Framework

Why was Spring WebFlux created?

Spring WebFlux is used for denoting the Reactive programming support in Spring's web layer. It provides support for both creating reactive, server-based web applications and also has client libraries to make remote REST calls.


Part of the answer is the need for a non-blocking web stack to handle concurrency with a small number of threads and scale with fewer hardware resources. Servlet 3.1 did provide an API for non-blocking I/O. However, using it leads away from the rest of the Servlet API, where contracts are synchronous (Filter, Servlet) or blocking (getParameter, getPart). This was the motivation for a new common API to serve as a foundation across any non-blocking runtime. That is important because of servers (such as Netty) that are well-established in the async, non-blocking space.



The other part of the answer is functional programming. Much as the addition of annotations in Java 5 created opportunities (such as annotated REST controllers or unit tests), the addition of lambda expressions in Java 8 created opportunities for functional APIs in Java. This is a boon for non-blocking applications and continuation-style APIs (as popularized by CompletableFuture and ReactiveX) that allow declarative composition of asynchronous logic. At the programming-model level, Java 8 enabled Spring WebFlux to offer functional web endpoints alongside annotated controllers.



Hope this video can bring you with new idea and happy day...

Help to subscribe, like and command to support my work.



Previous Post Next Post