As mentioned yesterday in Juergen’s blog post, the second milestone of Spring Framework 5.0 introduced a new functional web framework. In this post, I will give more information about the framework.
Keep in mind the functional web framework is built on the same reactive foundation that we provided in M1 and on which we also support annotation-based (i.e.
@RequestMapping) request handling, see the M1 blog post for more on that.
We start with some excerpts from our sample application. Below is a reactive repository that exposes
Person objects. It is quite similar to a traditional, non-reactive repository, except that it returns
Flux<Person> where you would return a
List<Person> traditionally, and
Mono<Person> where you would return a
Mono<Void> is used as a completion signal: to indicate when the save has been completed. For more information on these Reactor types, refer to Dave’s blog post.