public final class ConsumerChannelRegistry
Consumers register their primary channels with this class. This is used
to ensure that, when using transactions, the resource holder doesn't
close the primary channel being used by the Consumer.
This was previously in ConnectionFactoryUtils, but it caused a class
tangle with RabbitResourceHolder.
public static void registerConsumerChannel(com.rabbitmq.client.Channel channel,
If a listener container is configured to use a RabbitTransactionManager, the
consumer's channel is registered here so that it is used as the bound resource
when the transaction actually starts. It is normally not necessary to use
an external transaction manager because local transactions work the same in that
the channel is bound to the thread. This is for the case when a user happens
to wire in a RabbitTransactionManager.
channel - The channel to register.
connectionFactory - The connection factory.
public static void unRegisterConsumerChannel()
See registerConsumerChannel. This method is called to unregister
the channel when the consumer exits.
public static com.rabbitmq.client.Channel getConsumerChannel()
See registerConsumerChannel. This method is called to retrieve the
channel for this consumer.