Spring Webflux — Part 3

Reactive Programming is the newest trend in programming world. In this article series of Spring Webflux I have been discussing on how to build a Reactive Application using Spring Webflux. In the Part 2 we have discussed how to build a simple reactive application using Spring Boot. Lets dig deep into more advanced routing methods and filter functions in this article.

Context Path for Application

In Spring MVC can give a context path to our application. In Spring Webflux we don’t have a configuration for that. But we can set a context-path for multiple routes. Following is how we can do that.

Adding a Filter

Most often than not we want to secure our APIs. Spring Security has a more precise ways of securing an application, but here we want to have a simple key-base authentication for our application. For that we can use a simple filter function. First of all we have write an authenticator. Authenticator is a filter-function which will take ServerRequest and a HandlerFunction as arguments and return a ServerResponse.

A Tech Enthusiast who wants to build simple solutions for complex problems.