@Contract(threading=IMMUTABLE)
public class StandardServiceUnavailableRetryStrategy
extends java.lang.Object
implements org.apache.http.client.ServiceUnavailableRetryStrategy
ServiceUnavailableRetryStrategy
interface.
that retries 408
(Request Timeout), 429
(Too Many Requests),
and 500
(Server side error) responses for a fixed number of times at a fixed interval.Modifier and Type | Field and Description |
---|---|
private int |
maxRetries
Maximum number of allowed retries if the server responds with a HTTP code
in our retry code list.
|
private long |
retryInterval
Retry interval between subsequent requests, in milliseconds.
|
Constructor and Description |
---|
StandardServiceUnavailableRetryStrategy(int maxRetries,
int retryInterval) |
Modifier and Type | Method and Description |
---|---|
long |
getRetryInterval() |
boolean |
retryRequest(org.apache.http.HttpResponse response,
int executionCount,
org.apache.http.protocol.HttpContext context) |
private final int maxRetries
private final long retryInterval
public StandardServiceUnavailableRetryStrategy(int maxRetries, int retryInterval)
public boolean retryRequest(org.apache.http.HttpResponse response, int executionCount, org.apache.http.protocol.HttpContext context)
retryRequest
in interface org.apache.http.client.ServiceUnavailableRetryStrategy
public long getRetryInterval()
getRetryInterval
in interface org.apache.http.client.ServiceUnavailableRetryStrategy