Javadoc
A
RetrySimulator is a tool for exercising retry + backoff operations.
When calibrating a set of retry + backoff pairs, it is useful to know the behaviour
of the retry for various scenarios.
Things you may want to know:
- Does a 'maxInterval' of 5000 ms in my backoff even matter?
(This is often the case when retry counts are low -- so why set the max interval
at something that cannot be achieved?)
- What are the typical sleep durations for threads in a retry
- What was the longest sleep duration for any retry sequence
The simulator provides this information by executing a retry + backoff pair until failure
(that is all retries are exhausted). The information about each retry is provided
as part of the
RetrySimulation.
Note that the impetus for this class was to expose the timings which are possible with
org.springframework.retry.backoff.ExponentialRandomBackOffPolicy, which provides
random values and must be looked at over a series of trials.