Package com.rabbitmq.client
Class RecoveryDelayHandler.DefaultRecoveryDelayHandler
java.lang.Object
com.rabbitmq.client.RecoveryDelayHandler.DefaultRecoveryDelayHandler
- All Implemented Interfaces:
RecoveryDelayHandler
- Enclosing interface:
RecoveryDelayHandler
public static class RecoveryDelayHandler.DefaultRecoveryDelayHandler
extends Object
implements RecoveryDelayHandler
Basic implementation of
RecoveryDelayHandler
that returns the network recovery interval
each time.-
Nested Class Summary
Nested classes/interfaces inherited from interface com.rabbitmq.client.RecoveryDelayHandler
RecoveryDelayHandler.DefaultRecoveryDelayHandler, RecoveryDelayHandler.ExponentialBackoffDelayHandler
-
Constructor Summary
ConstructorDescriptionDefaultRecoveryDelayHandler
(long networkRecoveryInterval) Default Constructor -
Method Summary
Modifier and TypeMethodDescriptionlong
getDelay
(int recoveryAttempts) Get the time to sleep (in milliseconds) before attempting to reconnect and recover again.
-
Constructor Details
-
DefaultRecoveryDelayHandler
public DefaultRecoveryDelayHandler(long networkRecoveryInterval) Default Constructor- Parameters:
networkRecoveryInterval
- recovery delay time in millis
-
-
Method Details
-
getDelay
public long getDelay(int recoveryAttempts) Description copied from interface:RecoveryDelayHandler
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.- Specified by:
getDelay
in interfaceRecoveryDelayHandler
- Parameters:
recoveryAttempts
- The number of recovery attempts so far.- Returns:
- the delay in milliseconds
-