public enum RetryMode extends Enum<RetryMode>
LEGACY retry mode will
retry up to three times, and the STANDARD will retry up to two times.
While the LEGACY retry mode is specific to Java, the STANDARD retry mode is standardized across all of the
AWS SDKs.
The retry mode can be configured:
ClientOverrideConfiguration.Builder#retryPolicy(RetryMode).RetryPolicy.builder(RetryMode) or
RetryPolicy.forRetryMode(RetryMode), and ClientOverrideConfiguration.Builder#retryPolicy(RetryPolicy)| Modifier and Type | Class and Description |
|---|---|
static class |
RetryMode.Resolver
Allows customizing the variables used during determination of a
RetryMode. |
| Enum Constant and Description |
|---|
ADAPTIVE
Deprecated.
As of 2.25.xx, replaced by
ADAPTIVE_V2. The ADAPTIVE implementation has a bug that prevents it
from remembering its state across requests which is needed to correctly estimate its sending rate. Given that
this bug has been present since its introduction and that correct version might change the traffic patterns of the SDK we
deemed too risky to fix this implementation. |
ADAPTIVE_V2
Adaptive V2 retry mode builds on
STANDARD mode. |
LEGACY
The LEGACY retry mode, specific to the Java SDK, and characterized by:
Up to 3 retries, or more for services like DynamoDB (which has up to 8).
Zero token are subtracted from the
TokenBucketRetryCondition when throttling exceptions are encountered. |
STANDARD
The STANDARD retry mode, shared by all AWS SDK implementations, and characterized by:
Up to 2 retries, regardless of service.
Throttling exceptions are treated the same as other exceptions for the purposes of the
TokenBucketRetryCondition.
|
| Modifier and Type | Method and Description |
|---|---|
static RetryMode |
defaultRetryMode()
Retrieve the default retry mode by consulting the locations described in
RetryMode, or LEGACY if no value is
configured. |
static RetryMode.Resolver |
resolver()
Create a
RetryMode.Resolver that allows customizing the variables used during determination of a RetryMode. |
static RetryMode |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static RetryMode[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final RetryMode LEGACY
TokenBucketRetryCondition when throttling exceptions are encountered.
This is the retry mode that is used when no other mode is configured.
public static final RetryMode STANDARD
TokenBucketRetryCondition.@Deprecated public static final RetryMode ADAPTIVE
ADAPTIVE_V2. The ADAPTIVE implementation has a bug that prevents it
from remembering its state across requests which is needed to correctly estimate its sending rate. Given that
this bug has been present since its introduction and that correct version might change the traffic patterns of the SDK we
deemed too risky to fix this implementation.STANDARD mode.
Adaptive retry mode dynamically limits the rate of AWS requests to maximize success rate. This may be at the expense of request latency. Adaptive retry mode is not recommended when predictable latency is important.
Warning: Adaptive retry mode assumes that the client is working against a single resource (e.g. one DynamoDB Table or one S3 Bucket). If you use a single client for multiple resources, throttling or outages associated with one resource will result in increased latency and failures when accessing all other resources via the same client. When using adaptive retry mode, we recommend using a single client per resource.
RetryPolicy.isFastFailRateLimiting()public static final RetryMode ADAPTIVE_V2
STANDARD mode.
Adaptive retry mode dynamically limits the rate of AWS requests to maximize success rate. This may be at the expense of request latency. Adaptive V2 retry mode is not recommended when predictable latency is important.
ADAPTIVE_V2 mode differs from ADAPTIVE mode in the computed delays between calls, including the first
attempt
that might be delayed if the algorithm considers that it's needed to increase the odds of a successful response.
Warning: Adaptive V2 retry mode assumes that the client is working against a single resource (e.g. one DynamoDB Table or one S3 Bucket). If you use a single client for multiple resources, throttling or outages associated with one resource will result in increased latency and failures when accessing all other resources via the same client. When using adaptive retry mode, we recommend using a single client per resource.
public static RetryMode[] values()
for (RetryMode c : RetryMode.values()) System.out.println(c);
public static RetryMode valueOf(String name)
name - the name of the enum constant to be returned.IllegalArgumentException - if this enum type has no constant with the specified nameNullPointerException - if the argument is nullpublic static RetryMode defaultRetryMode()
RetryMode, or LEGACY if no value is
configured.public static RetryMode.Resolver resolver()
RetryMode.Resolver that allows customizing the variables used during determination of a RetryMode.Copyright © 2026. All rights reserved.