Package pl.gsmservice.gateway.utils
Class BackoffStrategy
- java.lang.Object
-
- pl.gsmservice.gateway.utils.BackoffStrategy
-
public class BackoffStrategy extends java.lang.ObjectExponential 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 classBackoffStrategy.Builder
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description doublebaseFactor()static BackoffStrategy.Builderbuilder()doubleexponent()Deprecated.usebaseFactor()instead.longinitialIntervalMs()doublejitterFactor()longmaxElapsedTimeMs()longmaxIntervalMs()booleanretryConnectError()booleanretryReadTimeoutError()static BackoffStrategywithDefaults()
-
-
-
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()
-
-