HttpRequestRetryStrategy interface.
| Modifier and Type | Field and Description |
|---|---|
| private final TimeValue | defaultRetryInterval
Retry interval between subsequent retries |
| public static final DefaultHttpRequestRetryStrategy | |
| private final int | maxRetries
Maximum number of allowed retries |
| private final Set | nonRetriableIOExceptionClasses
Derived |
| private final Set | retriableCodes
HTTP status codes which shall be retried |
| Access | Constructor and Description |
|---|---|
| protected | DefaultHttpRequestRetryStrategy(final int maxRetries, final TimeValue defaultRetryInterval, final Collection<Class<? extends IOException>> clazzes, final Collection<Integer> codes)
|
| public | DefaultHttpRequestRetryStrategy(final int
how many times to retry; 0 means no retries maxRetries, final TimeValue the default retry interval between
subsequent retries if the defaultRetryInterval)Retry-After header is not set
or invalid.Create the HTTP request retry strategy using the following list of non-retriable I/O exception classes:
|
| public | DefaultHttpRequestRetryStrategy()
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:
|
| Modifier and Type | Method and Description |
|---|---|
| public TimeValue | getRetryInterval(final HttpResponse
the response from the target server response, final int the number of times this method has been
unsuccessfully executed execCount, final HttpContext the context for the request execution context)Implements org. |
| protected boolean | |
| public boolean | retryRequest(final HttpRequest
the request failed due to an I/O exception request, final IOException the exception that occurred exception, final int the number of times this method has been
unsuccessfully executed execCount, final HttpContext the context for the request execution context)Implements org. |
| public boolean | retryRequest(final HttpResponse
the response from the target server response, final int the number of times this method has been
unsuccessfully executed execCount, final HttpContext the context for the request execution context)Implements org. |
| defaultRetryInterval | back to summary |
|---|---|
| private final TimeValue defaultRetryInterval Retry interval between subsequent retries | |
| INSTANCE | back to summary |
|---|---|
| public static final DefaultHttpRequestRetryStrategy INSTANCE | |
| maxRetries | back to summary |
|---|---|
| private final int maxRetries Maximum number of allowed retries | |
| nonRetriableIOExceptionClasses | back to summary |
|---|---|
| private final Set<Class<? extends IOException>> nonRetriableIOExceptionClasses Derived | |
| retriableCodes | back to summary |
|---|---|
| private final Set<Integer> retriableCodes HTTP status codes which shall be retried | |
| DefaultHttpRequestRetryStrategy | back to summary |
|---|---|
| protected DefaultHttpRequestRetryStrategy(final int maxRetries, final TimeValue defaultRetryInterval, final Collection<Class<? extends IOException>> clazzes, final Collection<Integer> codes) | |
| DefaultHttpRequestRetryStrategy | back to summary |
|---|---|
| public DefaultHttpRequestRetryStrategy(final int maxRetries, final TimeValue defaultRetryInterval) Create the HTTP request retry strategy using the following list of
non-retriable I/O exception classes:
| |
| DefaultHttpRequestRetryStrategy | back to summary |
|---|---|
| public DefaultHttpRequestRetryStrategy() 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:
| |
| getRetryInterval | back to summary |
|---|---|
| public TimeValue getRetryInterval(final HttpResponse response, final int execCount, final HttpContext context) Implements org. Doc from org. Determines the retry interval between subsequent retries.
| |
| handleAsIdempotent | back to summary |
|---|---|
| protected boolean handleAsIdempotent(final HttpRequest request) | |
| retryRequest | back to summary |
|---|---|
| public boolean retryRequest(final HttpRequest request, final IOException exception, final int execCount, final HttpContext context) Implements org. Doc from org. Determines if a method should be retried after an I/O exception occurred during execution.
| |
| retryRequest | back to summary |
|---|---|
| public boolean retryRequest(final HttpResponse response, final int execCount, final HttpContext context) Implements org. Doc from org. Determines if a method should be retried given the response from the target server.
| |