1

I have put few attempts for retry for web requests, but I want to control overall timeout as well, like the any request which comes from the client to the webclient should not take more then 60 seconds which included retry as well.

Now, I see the options to control per http read level as belowv:

        HttpClient httpClient = HttpClient.create()
                .option(ChannelOption.CONNECT_TIMEOUT_MILLIS, 12000)
                .responseTimeout(Duration.ofMillis(60000));

            return WebClient.builder()
                    .clientConnector(new ReactorClientHttpConnector(httpClient))
                    .defaultHeaders( h -> {
                        h.setContentType(MediaType.APPLICATION_JSON);
                        h.setAccept(List.of(MediaType.APPLICATION_JSON));
                    })
                    .build();

Now, this doesnot include the retry time which might happen in case of any error. So how to control the enforce overall time in such case..

Onki
  • 1,879
  • 6
  • 38
  • 58

0 Answers0