Class BackoffStrategy

java.lang.Object
com.styra.opa.openapi.utils.BackoffStrategy

public class BackoffStrategy extends Object
Exponential Backoff Strategy with Jitter The duration between consecutive attempts is calculated as follows: intervalMs = min(maxIntervalMs, initialIntervalMs*(baseFactor^attempts) +/- r) where baseFactor is the base factor and r a random value between 0 and jitterFactor*intervalMs.
  • Method Details

    • withDefaults

      public static BackoffStrategy withDefaults()
    • initialIntervalMs

      public long initialIntervalMs()
    • maxIntervalMs

      public long maxIntervalMs()
    • baseFactor

      public double baseFactor()
    • exponent

      @Deprecated public double exponent()
      Deprecated.
      use baseFactor() instead.
    • maxElapsedTimeMs

      public long maxElapsedTimeMs()
    • jitterFactor

      public double jitterFactor()
    • retryConnectError

      public boolean retryConnectError()
    • retryReadTimeoutError

      public boolean retryReadTimeoutError()
    • builder

      public static final BackoffStrategy.Builder builder()