|
Spring AMQP | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.springframework.amqp.rabbit.connection.ConnectionFactoryUtils
public class ConnectionFactoryUtils
Helper class for managing a Spring based Rabbit ConnectionFactory
,
in particular for obtaining transactional Rabbit resources for a given ConnectionFactory.
Mainly for internal use within the framework. Used by RabbitTemplate
as
well as SimpleMessageListenerContainer
.
Nested Class Summary | |
---|---|
static interface |
ConnectionFactoryUtils.ResourceFactory
Callback interface for resource creation. |
Constructor Summary | |
---|---|
ConnectionFactoryUtils()
|
Method Summary | |
---|---|
static void |
bindResourceToTransaction(RabbitResourceHolder resourceHolder,
ConnectionFactory connectionFactory,
boolean synched)
|
static RabbitResourceHolder |
getTransactionalResourceHolder(ConnectionFactory cf,
boolean synchedLocalTransactionAllowed)
Obtain a RabbitMQ Channel that is synchronized with the current transaction, if any. |
static boolean |
isChannelTransactional(com.rabbitmq.client.Channel channel,
ConnectionFactory connectionFactory)
Determine whether the given RabbitMQ Channel is transactional, that is, bound to the current thread by Spring's transaction facilities. |
static void |
registerDeliveryTag(ConnectionFactory connectionFactory,
com.rabbitmq.client.Channel channel,
Long tag)
|
static void |
releaseConnection(Connection con)
Release the given Connection by closing it. |
static void |
releaseResources(RabbitResourceHolder resourceHolder)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ConnectionFactoryUtils()
Method Detail |
---|
public static void releaseConnection(Connection con)
public static boolean isChannelTransactional(com.rabbitmq.client.Channel channel, ConnectionFactory connectionFactory)
channel
- the RabbitMQ Channel to checkconnectionFactory
- the RabbitMQ ConnectionFactory that the Channel originated from
public static RabbitResourceHolder getTransactionalResourceHolder(ConnectionFactory cf, boolean synchedLocalTransactionAllowed)
cf
- the ConnectionFactory to obtain a Channel forsynchedLocalTransactionAllowed
- whether to allow for a local RabbitMQ transaction that is synchronized with
a Spring-managed transaction (where the main transaction might be a JDBC-based one for a specific DataSource, for
example), with the RabbitMQ transaction committing right after the main transaction. If not allowed, the given
ConnectionFactory needs to handle transaction enlistment underneath the covers.
null
if none foundpublic static void releaseResources(RabbitResourceHolder resourceHolder)
public static void bindResourceToTransaction(RabbitResourceHolder resourceHolder, ConnectionFactory connectionFactory, boolean synched)
public static void registerDeliveryTag(ConnectionFactory connectionFactory, com.rabbitmq.client.Channel channel, Long tag) throws IOException
IOException
|
Spring AMQP | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |