Package software.amazon.awssdk.retries
Interface AdaptiveRetryStrategy
-
- All Superinterfaces:
RetryStrategy
- All Known Implementing Classes:
DefaultAdaptiveRetryStrategy
@ThreadSafe public interface AdaptiveRetryStrategy extends RetryStrategy
The adaptive retry strategy is aRetryStrategywhen executing against a very resource-constrained set of resources.Unlike
StandardRetryStrategy, care should be taken when using this strategy. Specifically, it should be used:- When the availability of downstream resources are mostly affected by callers that are also using
the
AdaptiveRetryStrategy. - The scope (either the whole strategy or the
AcquireInitialTokenRequest.scope()) of the strategy is constrained to target "resource", so that availability issues in one resource cannot delay other, unrelated resource's availability.
The adaptive retry strategy by default:
- Retries on the conditions configured in the
AdaptiveRetryStrategy.Builder. - Retries 2 times (3 total attempts). Adjust with
RetryStrategy.Builder.maxAttempts(int) - Uses a dynamic backoff delay based on load currently perceived against the downstream resource
- Circuit breaking (disabling retries) in the event of high downstream failures within an individual scope. The circuit breaking will never prevent the first attempt
- See Also:
StandardRetryStrategy
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interfaceAdaptiveRetryStrategy.Builder
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description static AdaptiveRetryStrategy.Builderbuilder()Create a newAdaptiveRetryStrategy.Builder.AdaptiveRetryStrategy.BuildertoBuilder()-
Methods inherited from interface software.amazon.awssdk.retries.api.RetryStrategy
acquireInitialToken, maxAttempts, recordSuccess, refreshRetryToken, useClientDefaults
-
-
-
-
Method Detail
-
builder
static AdaptiveRetryStrategy.Builder builder()
Create a newAdaptiveRetryStrategy.Builder.Example Usage
AdaptiveRetryStrategy retryStrategy = AdaptiveRetryStrategy.builder() .retryOnExceptionInstanceOf(IllegalArgumentException.class) .retryOnExceptionInstanceOf(IllegalStateException.class) .build();
-
toBuilder
AdaptiveRetryStrategy.Builder toBuilder()
- Specified by:
toBuilderin interfaceRetryStrategy
-
-