public class RabbitAdmin
extends java.lang.Object
implements org.springframework.amqp.core.AmqpAdmin, org.springframework.context.ApplicationContextAware, org.springframework.beans.factory.InitializingBean
| Modifier and Type | Field and Description |
|---|---|
protected static java.lang.String |
DEFAULT_EXCHANGE_NAME |
protected org.apache.commons.logging.Log |
logger
Logger available to subclasses
|
protected static java.lang.Object |
QUEUE_CONSUMER_COUNT |
protected static java.lang.Object |
QUEUE_MESSAGE_COUNT |
protected static java.lang.Object |
QUEUE_NAME |
| Constructor and Description |
|---|
RabbitAdmin(ConnectionFactory connectionFactory) |
| Modifier and Type | Method and Description |
|---|---|
void |
afterPropertiesSet()
If
autoStartup is set to true, registers a callback on the
ConnectionFactory to declare all exchanges and queues in the enclosing application context. |
void |
declareBinding(org.springframework.amqp.core.Binding binding) |
void |
declareExchange(org.springframework.amqp.core.Exchange exchange) |
org.springframework.amqp.core.Queue |
declareQueue()
Declares a server-named exclusive, autodelete, non-durable queue.
|
java.lang.String |
declareQueue(org.springframework.amqp.core.Queue queue)
Declare the given queue.
|
boolean |
deleteExchange(java.lang.String exchangeName) |
boolean |
deleteQueue(java.lang.String queueName) |
void |
deleteQueue(java.lang.String queueName,
boolean unused,
boolean empty) |
java.util.Properties |
getQueueProperties(java.lang.String queueName)
Returns 3 properties
QUEUE_NAME, QUEUE_MESSAGE_COUNT,
QUEUE_CONSUMER_COUNT, or null if the queue doesn't exist. |
RabbitTemplate |
getRabbitTemplate() |
void |
initialize()
Declares all the exchanges, queues and bindings in the enclosing application context, if any.
|
boolean |
isAutoStartup() |
void |
purgeQueue(java.lang.String queueName,
boolean noWait) |
void |
removeBinding(org.springframework.amqp.core.Binding binding) |
void |
setApplicationContext(org.springframework.context.ApplicationContext applicationContext) |
void |
setAutoStartup(boolean autoStartup) |
void |
setIgnoreDeclarationExceptions(boolean ignoreDeclarationExceptions) |
protected static final java.lang.String DEFAULT_EXCHANGE_NAME
protected static final java.lang.Object QUEUE_NAME
protected static final java.lang.Object QUEUE_MESSAGE_COUNT
protected static final java.lang.Object QUEUE_CONSUMER_COUNT
protected final org.apache.commons.logging.Log logger
public RabbitAdmin(ConnectionFactory connectionFactory)
public void setAutoStartup(boolean autoStartup)
public void setApplicationContext(org.springframework.context.ApplicationContext applicationContext)
setApplicationContext in interface org.springframework.context.ApplicationContextAwarepublic void setIgnoreDeclarationExceptions(boolean ignoreDeclarationExceptions)
public RabbitTemplate getRabbitTemplate()
public void declareExchange(org.springframework.amqp.core.Exchange exchange)
declareExchange in interface org.springframework.amqp.core.AmqpAdmin@ManagedOperation public boolean deleteExchange(java.lang.String exchangeName)
deleteExchange in interface org.springframework.amqp.core.AmqpAdmin@ManagedOperation public java.lang.String declareQueue(org.springframework.amqp.core.Queue queue)
declareQueue in interface org.springframework.amqp.core.AmqpAdmin@ManagedOperation public org.springframework.amqp.core.Queue declareQueue()
declareQueue in interface org.springframework.amqp.core.AmqpAdmin@ManagedOperation public boolean deleteQueue(java.lang.String queueName)
deleteQueue in interface org.springframework.amqp.core.AmqpAdmin@ManagedOperation
public void deleteQueue(java.lang.String queueName,
boolean unused,
boolean empty)
deleteQueue in interface org.springframework.amqp.core.AmqpAdmin@ManagedOperation
public void purgeQueue(java.lang.String queueName,
boolean noWait)
purgeQueue in interface org.springframework.amqp.core.AmqpAdmin@ManagedOperation public void declareBinding(org.springframework.amqp.core.Binding binding)
declareBinding in interface org.springframework.amqp.core.AmqpAdmin@ManagedOperation public void removeBinding(org.springframework.amqp.core.Binding binding)
removeBinding in interface org.springframework.amqp.core.AmqpAdminpublic java.util.Properties getQueueProperties(java.lang.String queueName)
QUEUE_NAME, QUEUE_MESSAGE_COUNT,
QUEUE_CONSUMER_COUNT, or null if the queue doesn't exist.getQueueProperties in interface org.springframework.amqp.core.AmqpAdminpublic boolean isAutoStartup()
public void afterPropertiesSet()
autoStartup is set to true, registers a callback on the
ConnectionFactory to declare all exchanges and queues in the enclosing application context. If the
callback fails then it may cause other clients of the connection factory to fail, but since only exchanges,
queues and bindings are declared failure is not expected.afterPropertiesSet in interface org.springframework.beans.factory.InitializingBeanInitializingBean.afterPropertiesSet(),
initialize()public void initialize()