Interface RetryPolicy.Builder
- All Superinterfaces:
Buildable
,CopyableBuilder<RetryPolicy.Builder,
,RetryPolicy> SdkBuilder<RetryPolicy.Builder,
RetryPolicy>
- Enclosing class:
RetryPolicy
-
Method Summary
Modifier and TypeMethodDescriptionboolean
additionalRetryConditionsAllowed
(boolean additionalRetryConditionsAllowed) Configure whether further conditions can be added to this policy after it is created.backoffStrategy
(BackoffStrategy backoffStrategy) Configure the backoff strategy that should be used for waiting in between retry attempts.build()
An immutable object that is created from the properties that have been set on the builder.fastFailRateLimiting
(Boolean fastFailRateLimiting) Whether the client should immediately fail the request when not enough capacity is immediately available from the rate limiter to execute the request, instead of waiting for capacity to be available.Whether the client should immediately fail the request when not enough capacity is immediately available from the rate limiter to execute the request, instead of waiting for capacity to be available.numRetries
(Integer numRetries) Configure the maximum number of times that a single request should be retried, assuming it fails for a retryable error.retryCapacityCondition
(RetryCondition retryCapacityCondition) Configure theRetryCondition
that should be used to throttle the number of retries attempted by the SDK client as a whole.retryCondition
(RetryCondition retryCondition) Configure the condition under which the request should be retried.throttlingBackoffStrategy
(BackoffStrategy backoffStrategy) Configure the backoff strategy that should be used for waiting in between retry attempts after a throttling error is encountered.Methods inherited from interface software.amazon.awssdk.utils.builder.CopyableBuilder
copy
Methods inherited from interface software.amazon.awssdk.utils.builder.SdkBuilder
applyMutation
-
Method Details
-
additionalRetryConditionsAllowed
Configure whether further conditions can be added to this policy after it is created. This may include service- specific retry conditions that may not otherwise be covered by theRetryCondition.defaultRetryCondition()
.By default, this is true.
-
additionalRetryConditionsAllowed
boolean additionalRetryConditionsAllowed()- See Also:
-
backoffStrategy
Configure the backoff strategy that should be used for waiting in between retry attempts. If the retry is because of throttling reasons, thethrottlingBackoffStrategy(BackoffStrategy)
is used instead. -
backoffStrategy
BackoffStrategy backoffStrategy()- See Also:
-
throttlingBackoffStrategy
Configure the backoff strategy that should be used for waiting in between retry attempts after a throttling error is encountered. If the retry is not because of throttling reasons, thebackoffStrategy(BackoffStrategy)
is used instead. -
throttlingBackoffStrategy
BackoffStrategy throttlingBackoffStrategy()- See Also:
-
retryCondition
Configure the condition under which the request should be retried.While this can be any interface that implements
RetryCondition
, it is encouraged to usenumRetries(Integer)
when attempting to limit the number of times the SDK will retry an attempt or theretryCapacityCondition(RetryCondition)
when attempting to configure the throttling of retries. This guidance is because the SDK uses theRetryPolicy.aggregateRetryCondition()
when determining whether or not to retry a request, and theaggregateRetryCondition
includes thenumRetries
andretryCapacityCondition
in its determination. -
retryCondition
RetryCondition retryCondition()- See Also:
-
retryCapacityCondition
Configure theRetryCondition
that should be used to throttle the number of retries attempted by the SDK client as a whole.While any
RetryCondition
(or null) can be used, by convention these conditions are usually stateful and work globally for the whole client to limit the overall capacity of the client to execute retries.By default the
TokenBucketRetryCondition
is used. This can be disabled by setting the value tonull
(notRetryPolicy#none()
, which would completely disable retries). -
retryCapacityCondition
RetryCondition retryCapacityCondition()- See Also:
-
numRetries
Configure the maximum number of times that a single request should be retried, assuming it fails for a retryable error. -
numRetries
Integer numRetries()- See Also:
-
fastFailRateLimiting
Whether the client should immediately fail the request when not enough capacity is immediately available from the rate limiter to execute the request, instead of waiting for capacity to be available.- Parameters:
fastFailRateLimiting
- Whether to fast fail.
-
isFastFailRateLimiting
Boolean isFastFailRateLimiting()Whether the client should immediately fail the request when not enough capacity is immediately available from the rate limiter to execute the request, instead of waiting for capacity to be available. -
build
RetryPolicy build()Description copied from interface:SdkBuilder
An immutable object that is created from the properties that have been set on the builder.- Specified by:
build
in interfaceBuildable
- Specified by:
build
in interfaceSdkBuilder<RetryPolicy.Builder,
RetryPolicy> - Returns:
- an instance of T
-