Right now I define retry strategy for each webClient call (like below)
public ModelResponse exampleMethod() {
return webClient
.get()
.uri("/example")
.retrieve()
.bodyToMono(ModelResponse.class)
.retryWhen(Retry.backoff(3, Duration.ofSeconds(1))
.filter(throwable -> throwable instanceof WebClientResponseException
&& ((WebClientResponseException) throwable).getStatusCode().is5xxServerError()))
.block();
}
I'd like to share the same retry strategy among all WebClients calls (for different methods and http requests).
Is it possible to set retry strategy on reactor.netty.http.client.HttpClient
and then use it to create WebClient
?