public final class ClosingRecoveryListener extends Object implements com.rabbitmq.client.RecoveryListener
RecoveryListener that closes the recovered channel, to avoid
orphaned consumers.| Modifier and Type | Method and Description |
|---|---|
static void |
addRecoveryListenerIfNecessary(com.rabbitmq.client.Channel channel)
Add a listener if necessary so we can immediately close an autorecovered
channel if necessary since the actual consumer will no longer exist.
|
void |
handleRecovery(com.rabbitmq.client.Recoverable recoverable) |
void |
handleRecoveryStarted(com.rabbitmq.client.Recoverable recoverable) |
static void |
removeChannel(com.rabbitmq.client.impl.recovery.AutorecoveringChannel channel)
Remove the channel from the set used to ensure that
addRecoveryListenerIfNecessary(Channel) is idempotent. |
public void handleRecovery(com.rabbitmq.client.Recoverable recoverable)
handleRecovery in interface com.rabbitmq.client.RecoveryListenerpublic void handleRecoveryStarted(com.rabbitmq.client.Recoverable recoverable)
handleRecoveryStarted in interface com.rabbitmq.client.RecoveryListenerpublic static void addRecoveryListenerIfNecessary(com.rabbitmq.client.Channel channel)
channel - the channel.public static void removeChannel(com.rabbitmq.client.impl.recovery.AutorecoveringChannel channel)
addRecoveryListenerIfNecessary(Channel) is idempotent.channel - the channel to remove.