Class DefaultLegacyRetryStrategy.Builder
- All Implemented Interfaces:
RetryStrategy.Builder<LegacyRetryStrategy.Builder,
,LegacyRetryStrategy> DefaultAwareRetryStrategy.Builder
,LegacyRetryStrategy.Builder
,Buildable
,SdkBuilder<LegacyRetryStrategy.Builder,
LegacyRetryStrategy>
- Enclosing class:
DefaultLegacyRetryStrategy
-
Method Summary
Modifier and TypeMethodDescriptionbackoffStrategy
(BackoffStrategy backoffStrategy) Configure the backoff strategy used by the retry strategy.build()
Build a newRetryStrategy
with the current configuration on this builder.circuitBreakerEnabled
(Boolean circuitBreakerEnabled) Whether circuit breaking is enabled for this strategy.maxAttempts
(int maxAttempts) Configure the maximum number of attempts used by the retry strategy.retryOnException
(Predicate<Throwable> shouldRetry) Configure the strategy to retry when the provided predicate returns true, given a failure exception.throttlingBackoffStrategy
(BackoffStrategy throttlingBackoffStrategy) Configure the backoff strategy used for throttling exceptions by this strategy.tokenBucketExceptionCost
(int exceptionCost) tokenBucketStore
(TokenBucketStore tokenBucketStore) tokenBucketThrottlingExceptionCost
(int throttlingExceptionCost) treatAsThrottling
(Predicate<Throwable> treatAsThrottling) Configure the predicate to allow the strategy categorize a Throwable as throttling exception.useClientDefaults
(boolean useClientDefaults) Configure whether the default predicates should be used, or not.Methods inherited from class software.amazon.awssdk.retries.internal.BaseRetryStrategy.Builder
markDefaultAdded
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface software.amazon.awssdk.retries.api.RetryStrategy.Builder
retryOnException, retryOnExceptionInstanceOf, retryOnExceptionOrCause, retryOnExceptionOrCauseInstanceOf, retryOnRootCause, retryOnRootCauseInstanceOf
Methods inherited from interface software.amazon.awssdk.utils.builder.SdkBuilder
applyMutation
-
Method Details
-
retryOnException
Description copied from interface:RetryStrategy.Builder
Configure the strategy to retry when the provided predicate returns true, given a failure exception.- Specified by:
retryOnException
in interfaceRetryStrategy.Builder<LegacyRetryStrategy.Builder,
LegacyRetryStrategy>
-
maxAttempts
Description copied from interface:RetryStrategy.Builder
Configure the maximum number of attempts used by the retry strategy.The actual number of attempts made may be less, depending on the retry strategy implementation. For example, the standard and adaptive retry modes both employ short-circuiting which reduces the maximum attempts during outages.
The default value for the standard and adaptive retry strategies is 3.
- Specified by:
maxAttempts
in interfaceRetryStrategy.Builder<LegacyRetryStrategy.Builder,
LegacyRetryStrategy>
-
backoffStrategy
Description copied from interface:RetryStrategy.Builder
Configure the backoff strategy used by the retry strategy.By default, this uses jittered exponential backoff.
- Specified by:
backoffStrategy
in interfaceRetryStrategy.Builder<LegacyRetryStrategy.Builder,
LegacyRetryStrategy>
-
throttlingBackoffStrategy
public DefaultLegacyRetryStrategy.Builder throttlingBackoffStrategy(BackoffStrategy throttlingBackoffStrategy) Description copied from interface:LegacyRetryStrategy.Builder
Configure the backoff strategy used for throttling exceptions by this strategy.By default, this uses jittered exponential backoff.
- Specified by:
throttlingBackoffStrategy
in interfaceLegacyRetryStrategy.Builder
- Specified by:
throttlingBackoffStrategy
in interfaceRetryStrategy.Builder<LegacyRetryStrategy.Builder,
LegacyRetryStrategy>
-
circuitBreakerEnabled
Description copied from interface:LegacyRetryStrategy.Builder
Whether circuit breaking is enabled for this strategy.The circuit breaker will prevent attempts (even below the
RetryStrategy.Builder.maxAttempts(int)
) if a large number of failures are observed by this executor.Note: The circuit breaker scope is local to the created
RetryStrategy
, and will therefore not be effective unless theRetryStrategy
is used for more than one call. It's recommended that aRetryStrategy
be reused for all calls to a single unreliable resource. It's also recommended that separateRetryStrategy
s be used for calls to unrelated resources.By default, this is
true
.- Specified by:
circuitBreakerEnabled
in interfaceLegacyRetryStrategy.Builder
-
treatAsThrottling
Description copied from interface:LegacyRetryStrategy.Builder
Configure the predicate to allow the strategy categorize a Throwable as throttling exception.- Specified by:
treatAsThrottling
in interfaceLegacyRetryStrategy.Builder
- Specified by:
treatAsThrottling
in interfaceRetryStrategy.Builder<LegacyRetryStrategy.Builder,
LegacyRetryStrategy>
-
tokenBucketExceptionCost
-
tokenBucketThrottlingExceptionCost
public DefaultLegacyRetryStrategy.Builder tokenBucketThrottlingExceptionCost(int throttlingExceptionCost) -
tokenBucketStore
-
useClientDefaults
Description copied from interface:RetryStrategy.Builder
Configure whether the default predicates should be used, or not. When set to false, only user-provided retry predicates will be considered to determine what should be retried or not. Setting this to false and providing no predicate will result in an empty retry strategy.- Specified by:
useClientDefaults
in interfaceRetryStrategy.Builder<LegacyRetryStrategy.Builder,
LegacyRetryStrategy>
-
build
Description copied from interface:RetryStrategy.Builder
Build a newRetryStrategy
with the current configuration on this builder.- Specified by:
build
in interfaceBuildable
- Specified by:
build
in interfaceLegacyRetryStrategy.Builder
- Specified by:
build
in interfaceRetryStrategy.Builder<LegacyRetryStrategy.Builder,
LegacyRetryStrategy> - Specified by:
build
in interfaceSdkBuilder<LegacyRetryStrategy.Builder,
LegacyRetryStrategy> - Returns:
- an instance of T
-