Class DecorrelatedJitterDelay

java.lang.Object
org.redisson.config.DecorrelatedJitterDelay
All Implemented Interfaces:
DelayStrategy

public class DecorrelatedJitterDelay extends Object implements DelayStrategy
Decorrelated jitter strategy that increases delay exponentially while introducing randomness influenced by the previous backoff duration. This approach helps avoid exponential growth that could lead to excessively long delays while ensuring each backoff duration is decorrelated from its predecessor.
Author:
Nikita Koksharov
  • Constructor Details

    • DecorrelatedJitterDelay

      public DecorrelatedJitterDelay(Duration minDelay, Duration maxDelay)
      Creates a decorrelated jitter delay strategy.
      Parameters:
      minDelay - the minimum delay duration (base delay)
      maxDelay - the maximum allowable delay duration
  • Method Details

    • calcDelay

      public Duration calcDelay(int attempt)
      Description copied from interface: DelayStrategy
      Calculates the delay duration to wait before the next retry attempt.
      Specified by:
      calcDelay in interface DelayStrategy
      Parameters:
      attempt - the zero-based retry attempt number (0 = first retry)
      Returns:
      the duration to wait before the next retry attempt