In this article, I will be providing a step-by-step guide to developing the Spring WebFlux RestFul API using a reactive programming approach along with Reactive MongoDB. Spring WebFlux is the spring framework step towards the reactive programming model. It uses Reactor to support the Reactive Streams API and runs on the netty server. Here we will be using Reactive MongoDB ... Read More »
Spring WebFlux
Get Client Remote Address from ServerExchange in Spring WebFlux and whitelist IP
Below is the Spring WebFlux code to fetch the client Remote Address from the ServerExchange object. Say, we have a scenario wherein we have to check if the API request is coming from the authorized IP address list, in the web filter we will fetch the IP address of the client and will match with the set of given IP’s ... Read More »
Spring WebFlux: WebClient Retry Strategies
In my last Spring WebFlux project, during the HTTP calls through WebClient, often I was not getting responses from the client. But when I tried by refreshing the page, the response was coming. There could be multiple reasons for not getting the proper response from the client, but I thought to implement retry options with WebClient. In the below, we ... Read More »
Handling Execptions Global Level in Spring Webflux REST API
Recently in one of my Spring Webflux project, one requirement came to handle Exceptions at Global Level. So the question is why we need global handling of exception. The benefit of handling exception at global level is, we can maintain proper error code at one level, this way we will be avoiding duplicate codes inside our spring webflux REST API ... Read More »