Package com.styra.opa.openapi.utils
Class BackoffStrategy
- java.lang.Object
-
- com.styra.opa.openapi.utils.BackoffStrategy
-
public class BackoffStrategy extends java.lang.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.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
BackoffStrategy.Builder
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description double
baseFactor()
static BackoffStrategy.Builder
builder()
double
exponent()
Deprecated.usebaseFactor()
instead.long
initialIntervalMs()
double
jitterFactor()
long
maxElapsedTimeMs()
long
maxIntervalMs()
boolean
retryConnectError()
boolean
retryReadTimeoutError()
static BackoffStrategy
withDefaults()
-
-
-
Method Detail
-
withDefaults
public static BackoffStrategy withDefaults()
-
initialIntervalMs
public long initialIntervalMs()
-
maxIntervalMs
public long maxIntervalMs()
-
baseFactor
public double baseFactor()
-
exponent
@Deprecated public double exponent()
Deprecated.usebaseFactor()
instead.
-
maxElapsedTimeMs
public long maxElapsedTimeMs()
-
jitterFactor
public double jitterFactor()
-
retryConnectError
public boolean retryConnectError()
-
retryReadTimeoutError
public boolean retryReadTimeoutError()
-
builder
public static final BackoffStrategy.Builder builder()
-
-