- All Superinterfaces:
public interface RetryStrategy extends Serializable
The lifecycle of a retry strategy begins whenever its covered action fails and ends in one of two ways: either a retry of the action is successful (the action is successfully undertaken, for example reconnect to a server succeeds) or the strategy gives up (for example it had a specified maximum number of retries, all of them had been attempted and none was successful).
Modifier and Type Method Description
()Function specifying how much time to wait before each retry attempt.
()Maximum number of retry attempt that should be made before giving up.
getMaxAttemptsint getMaxAttempts()Maximum number of retry attempt that should be made before giving up.
A value of 0 should be interpreted as "give up on first failure, without any retries".
A negative value should be interpreted as "retry indefinitely, until success".
getIntervalFunctionIntervalFunction getIntervalFunction()Function specifying how much time to wait before each retry attempt. Can specify a constant wait time, exponential backoff or any other, arbitrarily complex wait strategy.