@Override
    public boolean retryRequest(
            final HttpResponse response,
            final int execCount,
            final HttpContext context) {
        Args.notNull(response, "response");

        return execCount <= this.maxRetries && retriableCodes.contains(response.getCode());
    }
Create the HTTP request retry strategy with a max retry count of 1,
default retry interval of 1 second, and using the following list of
non-retriable I/O exception classes:<br>
<ul>
<li>InterruptedIOException</li>
<li>UnknownHostException</li>
<li>ConnectException</li>
<li>ConnectionClosedException</li>
<li>SSLException</li>
</ul>

and retriable HTTP status codes:<br>
<ul>
<li>SC_TOO_MANY_REQUESTS (429)</li>
<li>SC_SERVICE_UNAVAILABLE (503)</li>
</ul>
httpclient5/src/main/java/org/apache/hc/client5/http/impl/DefaultHttpRequestRetryStrategy.java