Package com.styra.opa.openapi.utils
Class BackoffStrategy
java.lang.Object
com.styra.opa.openapi.utils.BackoffStrategy
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 -
Method Summary
Modifier and TypeMethodDescriptiondouble
static final BackoffStrategy.Builder
builder()
double
exponent()
Deprecated.long
double
long
long
boolean
boolean
static BackoffStrategy
-
Method Details
-
withDefaults
-
initialIntervalMs
public long initialIntervalMs() -
maxIntervalMs
public long maxIntervalMs() -
baseFactor
public double baseFactor() -
exponent
Deprecated.usebaseFactor()
instead. -
maxElapsedTimeMs
public long maxElapsedTimeMs() -
jitterFactor
public double jitterFactor() -
retryConnectError
public boolean retryConnectError() -
retryReadTimeoutError
public boolean retryReadTimeoutError() -
builder
-
baseFactor()
instead.