List of usage examples for org.springframework.amqp.rabbit.connection RabbitResourceHolder containsChannel
public boolean containsChannel(Channel channel)
From source file:org.springframework.amqp.rabbit.connection.ConnectionFactoryUtils.java
/** * Determine whether the given RabbitMQ Channel is transactional, that is, * bound to the current thread by Spring's transaction facilities. * /*from w w w .java2 s . co m*/ * @param channel * the RabbitMQ Channel to check * @param connectionFactory * the RabbitMQ ConnectionFactory that the Channel originated * from * @return whether the Channel is transactional */ public static boolean isChannelTransactional(Channel channel, ConnectionFactory connectionFactory) { if (channel == null || connectionFactory == null) { return false; } RabbitResourceHolder resourceHolder = (RabbitResourceHolder) TransactionSynchronizationManager .getResource(connectionFactory); return (resourceHolder != null && resourceHolder.containsChannel(channel)); }