private HttpResponse executeWithRetries(HttpClient client, HttpUriRequest request) throws IOException {

        for (int attempt = 0; ; attempt++) {
            try {
                return client.execute(request);
            } catch (IOException exception) {
                if (attempt > 2) {
                    throw exception;
                }
            }
        }
    }
Executes the http request retrying the failed requests upto 3 times.
aws-java-sdk-core/src/test/java/com/amazonaws/internal/SdkProxyRoutePlannerIntegrationTest.java