Spring WebFlux
- A reactive framework introduced in Spring 5.
- Designed to provide a reactive programming model for building web apps and APIs with Spring.
- Built on top of Project Reactor, a popular reactive programming library for the JVM.
- Supported on Tomcat, Jetty, Servlet 3.1+ containers, and non-Servlet runtimes like Netty and Undertow.
Reactive database drivers
Some reactive drivers supported in Spring WebFlux:
- Reactive MongoDB driver — reactive support for MongoDB
- Reactive Redis driver — reactive support for Redis
- Reactive Cassandra driver — reactive support for Cassandra
Spring WebFlux supports two programming models:
- Traditional annotation-based model with
@Controller,@RequestMapping, and other MVC annotations. - A functional style model based on Java 8 lambdas for routing and handling requests.
Reactive REST APIs are asynchronous and return a Publisher (Mono or Flux).