Class ClosingRecoveryListener
- java.lang.Object
-
- org.springframework.amqp.rabbit.connection.ClosingRecoveryListener
-
- All Implemented Interfaces:
com.rabbitmq.client.RecoveryListener
public final class ClosingRecoveryListener extends Object implements com.rabbitmq.client.RecoveryListener
ARecoveryListener
that closes the recovered channel, to avoid orphaned consumers.- Since:
- 1.7.10
- Author:
- Gary Russell
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method 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 thataddRecoveryListenerIfNecessary(Channel)
is idempotent.
-
-
-
Method Detail
-
handleRecovery
public void handleRecovery(com.rabbitmq.client.Recoverable recoverable)
- Specified by:
handleRecovery
in interfacecom.rabbitmq.client.RecoveryListener
-
handleRecoveryStarted
public void handleRecoveryStarted(com.rabbitmq.client.Recoverable recoverable)
- Specified by:
handleRecoveryStarted
in interfacecom.rabbitmq.client.RecoveryListener
-
addRecoveryListenerIfNecessary
public 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. Idempotent operation.- Parameters:
channel
- the channel.
-
removeChannel
public static void removeChannel(com.rabbitmq.client.impl.recovery.AutorecoveringChannel channel)
Remove the channel from the set used to ensure thataddRecoveryListenerIfNecessary(Channel)
is idempotent.- Parameters:
channel
- the channel to remove.
-
-