org.springframework.amqp.rabbit.connection
Class RabbitUtils
java.lang.Object
org.springframework.amqp.rabbit.connection.RabbitUtils
public abstract class RabbitUtils
- extends Object
- Author:
- Mark Fisher, Mark Pollack
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DEFAULT_PORT
public static final int DEFAULT_PORT
- See Also:
- Constant Field Values
RabbitUtils
public RabbitUtils()
closeConnection
public static void closeConnection(Connection connection)
- Close the given RabbitMQ Connection and ignore any thrown exception. This is useful for typical
finally
blocks in manual RabbitMQ code.
- Parameters:
connection
- the RabbitMQ Connection to close (may be null
)
closeChannel
public static void closeChannel(com.rabbitmq.client.Channel channel)
- Close the given RabbitMQ Channel and ignore any thrown exception. This is useful for typical
finally
blocks in manual RabbitMQ code.
- Parameters:
channel
- the RabbitMQ Channel to close (may be null
)
commitIfNecessary
public static void commitIfNecessary(com.rabbitmq.client.Channel channel)
- Commit the Channel if not within a JTA transaction.
- Parameters:
channel
- the RabbitMQ Channel to commit
rollbackIfNecessary
public static void rollbackIfNecessary(com.rabbitmq.client.Channel channel)
convertRabbitAccessException
public static RuntimeException convertRabbitAccessException(Throwable ex)
closeMessageConsumer
public static void closeMessageConsumer(com.rabbitmq.client.Channel channel,
String consumerTag,
boolean transactional)
declareTransactional
public static void declareTransactional(com.rabbitmq.client.Channel channel)
- Declare to that broker that a channel is going to be used transactionally, and convert exceptions that arise.
- Parameters:
channel
- the channel to use
Copyright © 2011. All Rights Reserved.