Package com.rabbitmq.client
Interface RecoveryDelayHandler
-
- All Known Implementing Classes:
RecoveryDelayHandler.DefaultRecoveryDelayHandler
,RecoveryDelayHandler.ExponentialBackoffDelayHandler
public interface RecoveryDelayHandler
A RecoveryDelayHandler is used to tell automatic recovery how long to sleep between reconnect attempts.- Since:
- 4.3.0
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
RecoveryDelayHandler.DefaultRecoveryDelayHandler
Basic implementation ofRecoveryDelayHandler
that returns thenetwork recovery interval
each time.static class
RecoveryDelayHandler.ExponentialBackoffDelayHandler
Backoff implementation ofRecoveryDelayHandler
that uses the Fibonacci sequence (by default) to increase the recovery delay time after each failed attempt.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description long
getDelay(int recoveryAttempts)
Get the time to sleep (in milliseconds) before attempting to reconnect and recover again.
-
-
-
Method Detail
-
getDelay
long getDelay(int recoveryAttempts)
Get the time to sleep (in milliseconds) before attempting to reconnect and recover again. This method will be called with recoveryAttempts=0 before the first recovery attempt and then again after each failed recovery.- Parameters:
recoveryAttempts
- The number of recovery attempts so far.- Returns:
- the delay in milliseconds
-
-