Enum RetryMode
- All Implemented Interfaces:
Serializable,Comparable<RetryMode>
LEGACY retry mode will
retry up to three times, and the STANDARD will retry up to two times for most services.
While the LEGACY retry mode is specific to Java, the STANDARD retry mode is standardized across all of the
AWS SDKs.
The STANDARD retry mode is used when no other mode is configured.
The retry mode can be configured:
- Directly on a client via
ClientOverrideConfiguration.Builder.retryPolicy(RetryMode). - Directly on a client via a combination of
RetryPolicy.builder(RetryMode)orRetryPolicy.forRetryMode(RetryMode), andClientOverrideConfiguration.Builder.retryPolicy(RetryPolicy) - On a configuration profile via the "retry_mode" profile file property.
- Globally via the "aws.retryMode" system property.
- Globally via the "AWS_RETRY_MODE" environment variable.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classAllows customizing the variables used during determination of aRetryMode. -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionDeprecated.Adaptive V2 retry mode builds onSTANDARDmode.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 theTokenBucketRetryConditionwhen throttling exceptions are encountered.The STANDARD retry mode, shared by all AWS SDK implementations. -
Method Summary
Modifier and TypeMethodDescriptionstatic RetryModeRetrieve the default retry mode by consulting the locations described inRetryMode, or STANDARD if no value is configured.static RetryMode.Resolverresolver()Create aRetryMode.Resolverthat allows customizing the variables used during determination of aRetryMode.static RetryModeReturns 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.
-
Enum Constant Details
-
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
TokenBucketRetryConditionwhen throttling exceptions are encountered.
-
STANDARD
The STANDARD retry mode, shared by all AWS SDK implementations. When used with a retry strategy, it follows retry behavior 2.1, characterized by:- Up to 2 retries, or more for services like DynamoDB (which has up to 3). The
max_attemptsprofile property, theaws.maxAttemptssystem property and theAWS_MAX_ATTEMPTSenvironment variable override this. - A 50 ms base backoff, or 1 s for throttling errors.
- Each retry costs 14 tokens from the retry quota, or 5 for throttling errors.
When used with a
RetryPolicy, it keeps its previous behavior: up to 2 retries, and throttling exceptions are treated the same as other exceptions for the purposes of theTokenBucketRetryCondition.This is the retry mode that is used when no other mode is configured.
- Up to 2 retries, or more for services like DynamoDB (which has up to 3). The
-
ADAPTIVE
Deprecated.As of 2.25.xx, replaced byADAPTIVE_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 retry mode builds onSTANDARDmode.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.
- See Also:
-
ADAPTIVE_V2
Adaptive V2 retry mode builds onSTANDARDmode.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_V2mode differs fromADAPTIVEmode 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.
-
-
Method Details
-
values
Returns an array containing the constants of this enum type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum type has no constant with the specified nameNullPointerException- if the argument is null
-
defaultRetryMode
-
resolver
Create aRetryMode.Resolverthat allows customizing the variables used during determination of aRetryMode.
-
ADAPTIVE_V2.