Interface LegacyRetryStrategy
- All Superinterfaces:
RetryStrategy
- All Known Implementing Classes:
DefaultLegacyRetryStrategy
The legacy retry strategy is a
RetryStrategy for normal use-cases.
The legacy retry strategy by default:
- Retries on the conditions configured in the
LegacyRetryStrategy.Builder. - Retries 3 times (4 total attempts). Adjust with
RetryStrategy.Builder.maxAttempts(int) - For non-throttling exceptions uses the
BackoffStrategy.exponentialDelay(java.time.Duration, java.time.Duration)backoff strategy, with a base delay of 100 milliseconds and max delay of 20 seconds. Adjust withRetryStrategy.Builder.backoffStrategy(software.amazon.awssdk.retries.api.BackoffStrategy) - For throttling exceptions uses the
BackoffStrategy.exponentialDelayHalfJitter(java.time.Duration, java.time.Duration)backoff strategy, with a base delay of 500 milliseconds and max delay of 20 seconds. Adjust withLegacyRetryStrategy.Builder.throttlingBackoffStrategy(software.amazon.awssdk.retries.api.BackoffStrategy) - Circuit breaking (disabling retries) in the event of high downstream failures across the scope of
the strategy. The circuit breaking will never prevent a successful first attempt. Adjust with
LegacyRetryStrategy.Builder.circuitBreakerEnabled(java.lang.Boolean) - The state of the circuit breaker is not affected by throttling exceptions
- See Also:
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionstatic LegacyRetryStrategy.Builderbuilder()Create a newLegacyRetryStrategy.Builder.Create a newRetryStrategy.Builderwith the current configuration.Methods inherited from interface software.amazon.awssdk.retries.api.RetryStrategy
acquireInitialToken, maxAttempts, recordSuccess, refreshRetryToken
-
Method Details
-
builder
Create a newLegacyRetryStrategy.Builder.Example Usage
LegacyRetryStrategy retryStrategy = LegacyRetryStrategy.builder() .retryOnExceptionInstanceOf(IllegalArgumentException.class) .retryOnExceptionInstanceOf(IllegalStateException.class) .build(); -
toBuilder
LegacyRetryStrategy.Builder toBuilder()Description copied from interface:RetryStrategyCreate a newRetryStrategy.Builderwith the current configuration.This is useful for modifying the strategy's behavior, like conditions or max retries.
- Specified by:
toBuilderin interfaceRetryStrategy
-