WebClient for Reactive Calls
Call other services reactively.
What is WebClient
WebClient is the non-blocking, reactive HTTP client in Spring WebFlux. It replaces the blocking RestTemplate for reactive apps.
- Returns
Mono/Fluxresponses - Fully non-blocking on the Netty event loop
Building a WebClient
Create an instance with a base URL using the builder.
WebClient client = WebClient.builder()
.baseUrl("https://api.example.com")
.build();All lessons in this course
- Mono and Flux Basics
- Reactive Controllers
- WebClient for Reactive Calls
- Backpressure and Operators