Class DefaultStandardRetryStrategy.Builder
- All Implemented Interfaces:
RetryStrategy.Builder<StandardRetryStrategy.Builder,,StandardRetryStrategy> StandardRetryStrategy.Builder
- Enclosing class:
DefaultStandardRetryStrategy
-
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) treatAsThrottling(Predicate<Throwable> treatAsThrottling) Configure a predicate that determines whether a retryable exception is a 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<StandardRetryStrategy.Builder,StandardRetryStrategy>
-
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<StandardRetryStrategy.Builder,StandardRetryStrategy>
-
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<StandardRetryStrategy.Builder,StandardRetryStrategy>
-
throttlingBackoffStrategy
public DefaultStandardRetryStrategy.Builder throttlingBackoffStrategy(BackoffStrategy throttlingBackoffStrategy) 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<StandardRetryStrategy.Builder,StandardRetryStrategy>
-
treatAsThrottling
public DefaultStandardRetryStrategy.Builder treatAsThrottling(Predicate<Throwable> treatAsThrottling) Description copied from interface:RetryStrategy.BuilderConfigure a predicate that determines whether a retryable exception is a throttling exception. When this predicate returns true, the retry strategy will use theRetryStrategy.Builder.throttlingBackoffStrategy(software.amazon.awssdk.retries.api.BackoffStrategy). If it returns false, theRetryStrategy.Builder.backoffStrategy(software.amazon.awssdk.retries.api.BackoffStrategy)will be used. This predicate will not be called for non-retryable exceptions.- Specified by:
treatAsThrottlingin interfaceRetryStrategy.Builder<StandardRetryStrategy.Builder,StandardRetryStrategy>
-
circuitBreakerEnabled
Description copied from interface:StandardRetryStrategy.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 interfaceStandardRetryStrategy.Builder
-
tokenBucketExceptionCost
-
tokenBucketStore
-
build
Description copied from interface:RetryStrategy.BuilderBuild a newRetryStrategywith the current configuration on this builder.- Specified by:
buildin interfaceRetryStrategy.Builder<StandardRetryStrategy.Builder,StandardRetryStrategy> - Specified by:
buildin interfaceStandardRetryStrategy.Builder
-