Enum Class JitterStrategy

java.lang.Object
java.lang.Enum<JitterStrategy>
software.amazon.lambda.durable.retry.JitterStrategy
All Implemented Interfaces:
Serializable, Comparable<JitterStrategy>, Constable

public enum JitterStrategy extends Enum<JitterStrategy>
Jitter strategy for retry delays to prevent thundering herd problems.

Jitter reduces simultaneous retry attempts by spreading retries out over a randomized delay interval, which helps prevent overwhelming services when many clients retry at the same time.

  • Enum Constant Details

    • NONE

      public static final JitterStrategy NONE
      No jitter - use exact calculated delay. This provides predictable timing but may cause thundering herd issues.
    • FULL

      public static final JitterStrategy FULL
      Full jitter - random delay between 0 and calculated delay. This provides maximum spread but may result in very short delays.
    • HALF

      public static final JitterStrategy HALF
      Half jitter - random delay between 50% and 100% of calculated delay. This provides good spread while maintaining reasonable minimum delays.
  • Method Details

    • values

      public static JitterStrategy[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static JitterStrategy valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (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 class has no constant with the specified name
      NullPointerException - if the argument is null
    • apply

      public abstract double apply(double baseDelay)