Class ExponentialBackoffRetryPolicy

  • All Implemented Interfaces:
    RetryPolicy

    public class ExponentialBackoffRetryPolicy
    extends BaseRetryPolicy
    Retry policy with exponential backoff delay between attempts.

    The delay between the ith and (i + 1)th attempts is between delayScaleFactori * initialDelayMs and delayScaleFactor(i + 1) * initialDelayMs.

    • Constructor Detail

      • ExponentialBackoffRetryPolicy

        public ExponentialBackoffRetryPolicy​(int maxNumAttempts,
                                             long initialDelayMs,
                                             double delayScaleFactor)
    • Method Detail

      • getDelayMs

        protected long getDelayMs​(int currentAttempt)
        Description copied from class: BaseRetryPolicy
        Gets the delay in milliseconds before the next attempt.
        Specified by:
        getDelayMs in class BaseRetryPolicy
        Parameters:
        currentAttempt - Current attempt number
        Returns:
        Delay in milliseconds