public interface RetryStrategy
RetryPolicy
.Modifier and Type | Field and Description |
---|---|
static int |
HTTP_STATUS_TOO_MANY_REQUESTS |
Modifier and Type | Method and Description |
---|---|
Duration |
calculateRetryDelay(int retryAttempts)
Computes the delay between each retry.
|
int |
getMaxRetries()
Max number of retry attempts to be make.
|
default boolean |
shouldRetry(HttpResponse httpResponse)
This method is consulted to determine if a retry attempt should be made for the given
HttpResponse if the
retry attempts are less than RetryStrategy.getMaxRetries() . |
default boolean |
shouldRetryException(Throwable throwable)
This method is consulted to determine if a retry attempt should be made for the given
Throwable
propagated when the request failed to send. |
static final int HTTP_STATUS_TOO_MANY_REQUESTS
int getMaxRetries()
Duration calculateRetryDelay(int retryAttempts)
retryAttempts
- The number of retry attempts completed so far.default boolean shouldRetry(HttpResponse httpResponse)
HttpResponse
if the
retry attempts are less than RetryStrategy.getMaxRetries()
.httpResponse
- The response from the previous attempt.default boolean shouldRetryException(Throwable throwable)
Throwable
propagated when the request failed to send.throwable
- The Throwable
thrown during the previous attempt.Copyright © 2021 Microsoft Corporation. All rights reserved.