Spring WebClient and OAuth2 Support 1. Overview Spring Security 5 provides OAuth2 support for Spring Webflux’s non-blocking WebClient class. In this tutorial, we’ll analyze different approaches to access secured resources using this class. Also, we’ll have a look under the hood to understand how Spring handles the OAuth2 authorization process. 2.… Continue Reading spring-webclient-oauth2

Spring WebClient Requests with Parameters 1. Overview A lot of frameworks and projects are introducing reactive programming and asynchronous request handling. Consequently, Spring 5 introduced a reactive WebClient implementation as a part of the WebFlux framework. In this tutorial, we’ll see how to reactively consume REST API endpoints with WebClient.… Continue Reading webflux-webclient-parameters

Guide to Spring 5 WebFlux 1. Overview Spring WebFlux framework is part of Spring 5 and provides reactive programming support for web applications. In this tutorial, we’ll be creating a small reactive REST application using the reactive web components RestController and WebClient. We will also be looking at how to secure our reactive endpoints… Continue Reading spring-webflux

Spring WebClient Filters 1. Overview In this tutorial, we’re going to explore WebClient filters in Spring WebFlux, a functional, reactive web framework. 2. Request Filters A filter can intercept, examine, and modify a client request (or response). Filters are very suitable for adding functionality to every single request since the… Continue Reading spring-webclient-filters

Spring WebClient vs. RestTemplate 1. Introduction In this tutorial, we’re going to compare two of Spring’s web client implementations – RestTemplate and new Spring 5’s reactive alternative WebClient. 2. Blocking vs. Non-Blocking Client It’s a common requirement in web applications to make HTTP calls to other services. Therefore, we need… Continue Reading spring-webclient-resttemplate

Spring Security OAuth Login with WebFlux 1. Overview Spring Security added OAuth support for WebFlux starting with the 5.1.x GA. We’ll discuss how to configure our WebFlux application to use OAuth2 Login support. We’ll also discuss how to use WebClient to access OAuth2 secured resources. The OAuth Login configuration for… Continue Reading spring-oauth-login-webflux

Server-Sent Events in Spring 1. Overview In this tutorial, we’ll see how we can implement Server-Sent-Events-based APIs with Spring. Simply put, Server-Sent-Events, or SSE for short, is an HTTP standard that allows a web application to handle a unidirectional event stream and receive updates whenever server emits data. Spring 4.2… Continue Reading spring-server-sent-events