5

With the typical HttpAsyncClients example:

public class AsyncClientHttpExchange {

    public static void main(final String[] args) throws Exception {
        CloseableHttpAsyncClient httpclient = HttpAsyncClients.createDefault();
        try {
            httpclient.start();
            HttpGet request = new HttpGet("http://httpbin.org/get");
            Future<HttpResponse> future = httpclient.execute(request, null);
            HttpResponse response = future.get();
            System.out.println("Response: " + response.getStatusLine());
            System.out.println("Shutting down");
        } finally {
            httpclient.close();
        }
        System.out.println("Done");
    }
}

What is the way to set the number of retries in case there is no response?. I can see 5.

With httpClientBuilder there is the setRetryHandler :

httpClientBuilder.setRetryHandler(new MyRequestRetryHandler(_maxRetryCount));

What is the way with HttpAsyncClients?

Vadim Kotov
  • 8,084
  • 8
  • 48
  • 62
John Fadria
  • 1,863
  • 2
  • 25
  • 31

1 Answers1

10

HttpAsyncClient 4.x does not support automatic request re-execution. This feature is planned for HttpAsyncClient 5.0

ok2c
  • 26,450
  • 5
  • 63
  • 71