Spring 5 has the new module WebFlux to create reactive web applications. Spring WebFlux supports two programming models: traditional annotation-based programming model and functional programming model. In this post, we’ll going to scratch the surface of the new functional programming model. This post assumes that you already know concepts like
Mono in Reactor.
We’ll use a calculator service as the example. This service supports operations like
multiply with two operands. The parameter
operator specifies the operation to call, while parameters
v2 specify the two operands. For example, the url
/calculator?operator=add&v1=1&v2=2 invokes the
add operation with values