Enum RetryMode

java.lang.Object
java.lang.Enum<RetryMode>
software.amazon.awssdk.core.retry.RetryMode
All Implemented Interfaces:
Serializable, Comparable<RetryMode>

public enum RetryMode extends Enum<RetryMode>
A retry mode is a collection of retry behaviors encoded under a single value. For example, the 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:

  1. Directly on a client via ClientOverrideConfiguration.Builder.retryPolicy(RetryMode).
  2. Directly on a client via a combination of RetryPolicy.builder(RetryMode) or RetryPolicy.forRetryMode(RetryMode), and ClientOverrideConfiguration.Builder.retryPolicy(RetryPolicy)
  3. On a configuration profile via the "retry_mode" profile file property.
  4. Globally via the "aws.retryMode" system property.
  5. Globally via the "AWS_RETRY_MODE" environment variable.
  • Enum Constant Details

    • LEGACY

      public static final RetryMode LEGACY
      The LEGACY retry mode, specific to the Java SDK, and characterized by:
      1. Up to 3 retries, or more for services like DynamoDB (which has up to 8).
      2. Zero token are subtracted from the TokenBucketRetryCondition when throttling exceptions are encountered.

      This is the retry mode that is used when no other mode is configured.

    • STANDARD

      public static final RetryMode STANDARD
      The STANDARD retry mode, shared by all AWS SDK implementations, and characterized by:
      1. Up to 2 retries, regardless of service.
      2. Throttling exceptions are treated the same as other exceptions for the purposes of the TokenBucketRetryCondition.
    • ADAPTIVE

      public static final RetryMode ADAPTIVE
      Adaptive retry mode builds on 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.

      See Also:
  • Method Details

    • values

      public static RetryMode[] 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

      public static RetryMode valueOf(String name)
      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 name
      NullPointerException - if the argument is null
    • defaultRetryMode

      public static RetryMode defaultRetryMode()
      Retrieve the default retry mode by consulting the locations described in RetryMode, or LEGACY if no value is configured.
    • resolver

      public static RetryMode.Resolver resolver()
      Create a RetryMode.Resolver that allows customizing the variables used during determination of a RetryMode.