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 newRetryStrategywith 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
markDefaultAddedMethods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface software.amazon.awssdk.retries.api.RetryStrategy.Builder
retryOnException, retryOnExceptionInstanceOf, retryOnExceptionOrCause, retryOnExceptionOrCauseInstanceOf, retryOnRootCause, retryOnRootCauseInstanceOfMethods inherited from interface software.amazon.awssdk.utils.builder.SdkBuilder
applyMutation
-
Method Details
-
retryOnException
Description copied from interface:RetryStrategy.BuilderConfigure the strategy to retry when the provided predicate returns true, given a failure exception.- Specified by:
retryOnExceptionin interfaceRetryStrategy.Builder<LegacyRetryStrategy.Builder,LegacyRetryStrategy>
-
maxAttempts
Description copied from interface:RetryStrategy.BuilderConfigure 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:
maxAttemptsin interfaceRetryStrategy.Builder<LegacyRetryStrategy.Builder,LegacyRetryStrategy>
-
backoffStrategy
Description copied from interface:RetryStrategy.BuilderConfigure the backoff strategy used by the retry strategy.By default, this uses jittered exponential backoff.
- Specified by:
backoffStrategyin interfaceRetryStrategy.Builder<LegacyRetryStrategy.Builder,LegacyRetryStrategy>
-
throttlingBackoffStrategy
public DefaultLegacyRetryStrategy.Builder throttlingBackoffStrategy(BackoffStrategy throttlingBackoffStrategy) Description copied from interface:LegacyRetryStrategy.BuilderConfigure the backoff strategy used for throttling exceptions by this strategy.By default, this uses jittered exponential backoff.
- Specified by:
throttlingBackoffStrategyin interfaceLegacyRetryStrategy.Builder- Specified by:
throttlingBackoffStrategyin interfaceRetryStrategy.Builder<LegacyRetryStrategy.Builder,LegacyRetryStrategy>
-
circuitBreakerEnabled
Description copied from interface:LegacyRetryStrategy.BuilderWhether 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 theRetryStrategyis used for more than one call. It's recommended that aRetryStrategybe reused for all calls to a single unreliable resource. It's also recommended that separateRetryStrategys be used for calls to unrelated resources.By default, this is
true.- Specified by:
circuitBreakerEnabledin interfaceLegacyRetryStrategy.Builder
-
treatAsThrottling
Description copied from interface:LegacyRetryStrategy.BuilderConfigure the predicate to allow the strategy categorize a Throwable as throttling exception.- Specified by:
treatAsThrottlingin interfaceLegacyRetryStrategy.Builder- Specified by:
treatAsThrottlingin interfaceRetryStrategy.Builder<LegacyRetryStrategy.Builder,LegacyRetryStrategy>
-
tokenBucketExceptionCost
-
tokenBucketThrottlingExceptionCost
public DefaultLegacyRetryStrategy.Builder tokenBucketThrottlingExceptionCost(int throttlingExceptionCost) -
tokenBucketStore
-
useClientDefaults
Description copied from interface:RetryStrategy.BuilderConfigure 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:
useClientDefaultsin interfaceRetryStrategy.Builder<LegacyRetryStrategy.Builder,LegacyRetryStrategy>
-
build
Description copied from interface:RetryStrategy.BuilderBuild a newRetryStrategywith the current configuration on this builder.- Specified by:
buildin interfaceBuildable- Specified by:
buildin interfaceLegacyRetryStrategy.Builder- Specified by:
buildin interfaceRetryStrategy.Builder<LegacyRetryStrategy.Builder,LegacyRetryStrategy> - Specified by:
buildin interfaceSdkBuilder<LegacyRetryStrategy.Builder,LegacyRetryStrategy> - Returns:
- an instance of T
-