Class RetryPolicyAdapter.Builder
java.lang.Object
software.amazon.awssdk.core.internal.retry.RetryPolicyAdapter.Builder
- All Implemented Interfaces:
RetryStrategy.Builder<RetryPolicyAdapter.Builder,
RetryPolicyAdapter>
- Enclosing class:
RetryPolicyAdapter
public static class RetryPolicyAdapter.Builder
extends Object
implements RetryStrategy.Builder<RetryPolicyAdapter.Builder,RetryPolicyAdapter>
-
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.initialize
(RetryPolicyContext retryPolicyContext) 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.retryPolicy
(RetryPolicy retryPolicy) retryPolicyContext
(RetryPolicyContext retryPolicyContext) throttlingBackoffStrategy
(BackoffStrategy backoffStrategy) Configure the backoff strategy used for throttling exceptions by this strategy.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, wait
Methods inherited from interface software.amazon.awssdk.retries.api.RetryStrategy.Builder
retryOnException, retryOnExceptionInstanceOf, retryOnExceptionOrCause, retryOnExceptionOrCauseInstanceOf, retryOnRootCause, retryOnRootCauseInstanceOf
-
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<RetryPolicyAdapter.Builder,
RetryPolicyAdapter>
-
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<RetryPolicyAdapter.Builder,
RetryPolicyAdapter>
-
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<RetryPolicyAdapter.Builder,
RetryPolicyAdapter>
-
throttlingBackoffStrategy
Description copied from interface:RetryStrategy.Builder
Configure the backoff strategy used for throttling exceptions by this strategy.By default, this uses jittered exponential backoff.
- Specified by:
throttlingBackoffStrategy
in interfaceRetryStrategy.Builder<RetryPolicyAdapter.Builder,
RetryPolicyAdapter>
-
treatAsThrottling
Description copied from interface:RetryStrategy.Builder
Configure 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:
treatAsThrottling
in interfaceRetryStrategy.Builder<RetryPolicyAdapter.Builder,
RetryPolicyAdapter>
-
retryPolicy
-
retryPolicyContext
-
initialize
-
build
Description copied from interface:RetryStrategy.Builder
Build a newRetryStrategy
with the current configuration on this builder.- Specified by:
build
in interfaceRetryStrategy.Builder<RetryPolicyAdapter.Builder,
RetryPolicyAdapter>
-