Class RandomDelayRetryPolicy

  • All Implemented Interfaces:
    RetryPolicy

    public class RandomDelayRetryPolicy
    extends BaseRetryPolicy
    Delay policy with random delay between attempts.
    • Constructor Detail

      • RandomDelayRetryPolicy

        public RandomDelayRetryPolicy​(int maxNumAttempts,
                                      long minDelayMs,
                                      long maxDelayMs)
    • 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