public class ExponentialRandomBackOffPolicy extends ExponentialBackOffPolicy
ExponentialBackOffPolicythat chooses a random multiple of the interval that would come from a simple deterministic exponential. The random multiple is uniformly distributed between 1 and the deterministic multiplier (so in practice the interval is somewhere between the next and next but one intervals in the deterministic case). This has shown to at least be useful in testing scenarios where excessive contention is generated by the test needing many retries. In test, usually threads are started at the same time, and thus stomp together onto the next interval. Using this
BackOffPolicycan help avoid that scenario. Example: initialInterval = 50 multiplier = 2.0 maxInterval = 3000 numRetries = 5
ExponentialBackOffPolicyyields: [50, 100, 200, 400, 800]
ExponentialRandomBackOffPolicymay yield [76, 151, 304, 580, 901] or [53, 190, 267, 451, 815]
|Constructor and Description|
|Modifier and Type||Method and Description|
Returns a new instance of
backOff, cloneValues, getInitialInterval, getMaxInterval, getMultiplier, setInitialInterval, setMaxInterval, setMultiplier, setSleeper, toString, withSleeper
public BackOffContext start(RetryContext context)
BackOffContext, seeded with this policies settings.
Copyright © 2018 SpringSource. All rights reserved.