Interface StandardRetryStrategy
- All Superinterfaces:
RetryStrategy
- All Known Implementing Classes:
DefaultStandardRetryStrategy
The standard retry strategy is the recommended
RetryStrategy
for normal use-cases.
Unlike AdaptiveRetryStrategy
, the standard strategy is generally useful across all retry use-cases.
The standard retry strategy by default:
- Retries on the conditions configured in the
StandardRetryStrategy.Builder
. - Retries 2 times (3 total attempts). Adjust with
RetryStrategy.Builder.maxAttempts(int)
- Uses the
BackoffStrategy.exponentialDelay(java.time.Duration, java.time.Duration)
backoff strategy, with a base delay of 1 second and max delay of 20 seconds. Adjust withRetryStrategy.Builder.backoffStrategy(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
StandardRetryStrategy.Builder.circuitBreakerEnabled(java.lang.Boolean)
.
- See Also:
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionbuilder()
Create a newStandardRetryStrategy.Builder
.Create a newRetryStrategy.Builder
with the current configuration.Methods inherited from interface software.amazon.awssdk.retries.api.RetryStrategy
acquireInitialToken, maxAttempts, recordSuccess, refreshRetryToken
-
Method Details
-
builder
Create a newStandardRetryStrategy.Builder
.Example Usage
StandardRetryStrategy retryStrategy = StandardRetryStrategy.builder() .retryOnExceptionInstanceOf(IllegalArgumentException.class) .retryOnExceptionInstanceOf(IllegalStateException.class) .build();
-
toBuilder
StandardRetryStrategy.Builder toBuilder()Description copied from interface:RetryStrategy
Create a newRetryStrategy.Builder
with the current configuration.This is useful for modifying the strategy's behavior, like conditions or max retries.
- Specified by:
toBuilder
in interfaceRetryStrategy
-