上QQ阅读APP看书,第一时间看更新
Spring's new functional web framework – WebFlux
Another exciting feature to support reactive HTTP and WebSocket clients, the Spring Framework 5.0 provides the spring-webflux module. The Spring Framework 5.0 also provides support for REST, HTML, and WebSocket-style interactions for reactive web applications running on servers.
In spring-webflux, there are two major programming models on the server side:
- Support for @Controller annotation including other Spring MVC annotations
- Provision for functional style routing and handling with Java 8 Lambda
Spring spring-webflux also provides support for creating WebClient, which is reactive and non-blocking, as an alternative to RestTemplate.