Class DefaultAdaptiveRetryStrategy.Builder
java.lang.Object
software.amazon.awssdk.retries.internal.DefaultAdaptiveRetryStrategy.Builder
- All Implemented Interfaces:
AdaptiveRetryStrategy.Builder,RetryStrategy.Builder<AdaptiveRetryStrategy.Builder,AdaptiveRetryStrategy>
- Enclosing class:
DefaultAdaptiveRetryStrategy
public static class DefaultAdaptiveRetryStrategy.Builder
extends Object
implements AdaptiveRetryStrategy.Builder
-
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) maxAttempts(int maxAttempts) Configure the maximum number of attempts used by the retry strategy.rateLimiterTokenBucketStore(RateLimiterTokenBucketStore rateLimiterTokenBucketStore) retryOnException(Predicate<Throwable> shouldRetry) Configure the strategy to retry when the provided predicate returns true, given a failure exception.throttlingBackoffStrategy(BackoffStrategy backoffStrategy) Configure the backoff strategy used for throttling exceptions by this strategy.tokenBucketExceptionCost(int exceptionCost) tokenBucketStore(TokenBucketStore tokenBucketStore) treatAsThrottling(Predicate<Throwable> treatAsThrottling) Configure the predicate to allow the strategy categorize a Throwable as throttling exception.Methods 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, retryOnRootCauseInstanceOf
-
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<AdaptiveRetryStrategy.Builder,AdaptiveRetryStrategy>
-
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<AdaptiveRetryStrategy.Builder,AdaptiveRetryStrategy>
-
treatAsThrottling
public DefaultAdaptiveRetryStrategy.Builder treatAsThrottling(Predicate<Throwable> treatAsThrottling) Description copied from interface:AdaptiveRetryStrategy.BuilderConfigure the predicate to allow the strategy categorize a Throwable as throttling exception.- Specified by:
treatAsThrottlingin interfaceAdaptiveRetryStrategy.Builder- Specified by:
treatAsThrottlingin interfaceRetryStrategy.Builder<AdaptiveRetryStrategy.Builder,AdaptiveRetryStrategy>
-
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<AdaptiveRetryStrategy.Builder,AdaptiveRetryStrategy>
-
throttlingBackoffStrategy
public DefaultAdaptiveRetryStrategy.Builder throttlingBackoffStrategy(BackoffStrategy backoffStrategy) Description copied from interface:RetryStrategy.BuilderConfigure the backoff strategy used for throttling exceptions by this strategy.By default, this uses jittered exponential backoff.
- Specified by:
throttlingBackoffStrategyin interfaceRetryStrategy.Builder<AdaptiveRetryStrategy.Builder,AdaptiveRetryStrategy>
-
circuitBreakerEnabled
-
tokenBucketExceptionCost
-
rateLimiterTokenBucketStore
public DefaultAdaptiveRetryStrategy.Builder rateLimiterTokenBucketStore(RateLimiterTokenBucketStore rateLimiterTokenBucketStore) -
tokenBucketStore
-
build
Description copied from interface:RetryStrategy.BuilderBuild a newRetryStrategywith the current configuration on this builder.- Specified by:
buildin interfaceAdaptiveRetryStrategy.Builder- Specified by:
buildin interfaceRetryStrategy.Builder<AdaptiveRetryStrategy.Builder,AdaptiveRetryStrategy>
-