Medium WebClient & WebFlux
Chain Reactive Calls
Traducción al español en progresoEl contenido detallado de esta lección aún se está traduciendo. Mientras tanto, se muestra en inglés.
Simulate two chained WebClient calls. First, fetch a user ID from getActiveUserId() which returns Mono<Int> with value 42. Then, use flatMap to fetch user details from getUserDetails(id) which returns Mono<String> with "User #42 - Active". Print the final result.
This pattern is fundamental for composing multiple async HTTP calls.
Esperado
User #42 - Active
Main.kt