Enum RetryOptions.BackoffStrategy

    • Enum Constant Detail

      • FIXED

        public static final RetryOptions.BackoffStrategy FIXED
        Fixed delay - same wait time for each retry.

        Example with 1000ms base delay:

        • Attempt 1: 1000ms
        • Attempt 2: 1000ms
        • Attempt 3: 1000ms
      • LINEAR

        public static final RetryOptions.BackoffStrategy LINEAR
        Linear backoff - delay increases linearly with attempt number.

        Example with 1000ms base delay:

        • Attempt 1: 1000ms (1 × 1000)
        • Attempt 2: 2000ms (2 × 1000)
        • Attempt 3: 3000ms (3 × 1000)
      • EXPONENTIAL

        public static final RetryOptions.BackoffStrategy EXPONENTIAL
        Exponential backoff - delay doubles with each attempt.

        Example with 1000ms base delay:

        • Attempt 1: 1000ms (2⁰ × 1000)
        • Attempt 2: 2000ms (2¹ × 1000)
        • Attempt 3: 4000ms (2² × 1000)

        Recommended for most use cases as it quickly backs off to prevent overwhelming the server while allowing fast recovery.

      • CUSTOM

        public static final RetryOptions.BackoffStrategy CUSTOM
        Custom backoff strategy - delay is calculated by the user.

        Example with 1000ms base delay:

        • Attempt 1: 1000ms
        • Attempt 2: 2000ms
        • Attempt 3: 3000ms
    • Method Detail

      • values

        public static RetryOptions.BackoffStrategy[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (RetryOptions.BackoffStrategy c : RetryOptions.BackoffStrategy.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static RetryOptions.BackoffStrategy 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