I have following WebClient - makes http call to localhost:8090 - bean defined:
@Configuration
class WebClientConfig {
@Bean
public WebClient webClientBean() {
return WebClient.create("http://localhost:8090");
}
}
And a call another service (8090):
Response response = requestBodySpec
.retrieve()
.bodyToMono(Response.class)
.timeout(Duration.ofSeconds(5))
.retry(2L)
.doOnSuccess(res -> log.info(res))
.doOnError(err -> log.error(err))
.block();
I see the error after timing out:
java.util.concurrent.TimeoutException: Did not observe any item or terminal signal within 5000ms in 'flatMap'
But I am not seeing logs for the 2 additional retries that I specified; they are only visible when I turn on TRACE:
TRACE 2120 --- [nio-8080-exec-1] o.s.w.r.f.client.ExchangeFunctions : [9c7e1e0] HTTP POST http://localhost:8090/test, headers={masked}
Is there any way I can log the event whenever there is a retry happening? Similar to above log except I have to INFO log it.