public class RabbitManagementTemplate extends Object implements AmqpManagementOperations
Client providing convenient access to
the REST methods using the familiar Spring AMQP domain objects for Queue,
Exchange and Binding. For more complete access, including access to
properties not available in the Spring AMQP domain classes, use the Client
directly.| Constructor and Description |
|---|
RabbitManagementTemplate()
Construct a template using uri "localhost:15672/api/" and user guest/guest.
|
RabbitManagementTemplate(com.rabbitmq.http.client.Client rabbitClient)
Construct a template using the supplied client.
|
RabbitManagementTemplate(String uri)
Construct a template using the supplied uri.
|
RabbitManagementTemplate(String uri,
String username,
String password)
Construct a template using the supplied uri.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addExchange(Exchange exchange)
Add an exchange to the default vhost ('/').
|
void |
addExchange(String vhost,
Exchange exchange)
Add an exchange to the specified vhost.
|
void |
addQueue(Queue queue)
Add a queue to the default vhost ('/').
|
void |
addQueue(String vhost,
Queue queue)
Add a queue to the specified vhost.
|
void |
deleteExchange(Exchange exchange)
Delete an exchange from the default vhost ('/').
|
void |
deleteExchange(String vhost,
Exchange exchange)
Delete an exchange from the provided vhost.
|
void |
deleteQueue(Queue queue)
Delete a queue from the default vhost ('/').
|
void |
deleteQueue(String vhost,
Queue queue)
Delete a queue from the provided vhost.
|
List<Binding> |
getBindings()
Get all bindings.
|
List<Binding> |
getBindings(String vhost)
Get all bindings in the provided vhost.
|
List<Binding> |
getBindingsForExchange(String vhost,
String exchange)
Get all bindings from the provided exchange in the provided vhost.
|
com.rabbitmq.http.client.Client |
getClient() |
Exchange |
getExchange(String name)
Get a specific queue from the default vhost ('/').
|
Exchange |
getExchange(String vhost,
String name)
Get a specific exchange from the provided vhost.
|
List<Exchange> |
getExchanges()
Get all exchanges.
|
List<Exchange> |
getExchanges(String vhost)
Get all exchanges in the provided vhost.
|
Queue |
getQueue(String name)
Get a specific queue from the default vhost ('/').
|
Queue |
getQueue(String vhost,
String name)
Get a specific queue from the provided vhost.
|
List<Queue> |
getQueues()
Get all queues.
|
List<Queue> |
getQueues(String vhost)
Get all queues in the provided vhost.
|
void |
purgeQueue(Queue queue)
Purge a queue in the default vhost ('/').
|
void |
purgeQueue(String vhost,
Queue queue)
Purge a queue in the provided vhost.
|
public RabbitManagementTemplate()
public RabbitManagementTemplate(com.rabbitmq.http.client.Client rabbitClient)
rabbitClient - the client.public RabbitManagementTemplate(String uri)
uri - the uri - must include user info, e.g.
"http://guest:guest@localhost:15672/api/".public com.rabbitmq.http.client.Client getClient()
public void addExchange(Exchange exchange)
AmqpManagementOperationsaddExchange in interface AmqpManagementOperationsexchange - the exchange.public void addExchange(String vhost, Exchange exchange)
AmqpManagementOperationsaddExchange in interface AmqpManagementOperationsvhost - the vhost.exchange - the exchange.public void purgeQueue(Queue queue)
AmqpManagementOperationspurgeQueue in interface AmqpManagementOperationsqueue - the queue.public void purgeQueue(String vhost, Queue queue)
AmqpManagementOperationspurgeQueue in interface AmqpManagementOperationsvhost - the vhost.queue - the queue.public void deleteQueue(Queue queue)
AmqpManagementOperationsdeleteQueue in interface AmqpManagementOperationsqueue - the queue.public void deleteQueue(String vhost, Queue queue)
AmqpManagementOperationsdeleteQueue in interface AmqpManagementOperationsvhost - the vhost.queue - the queue.public Queue getQueue(String name)
AmqpManagementOperationsgetQueue in interface AmqpManagementOperationsname - the queue name.public Queue getQueue(String vhost, String name)
AmqpManagementOperationsgetQueue in interface AmqpManagementOperationsvhost - the vhost.name - the queue name.public List<Queue> getQueues()
AmqpManagementOperationsgetQueues in interface AmqpManagementOperationspublic List<Queue> getQueues(String vhost)
AmqpManagementOperationsgetQueues in interface AmqpManagementOperationsvhost - the vhost.public void addQueue(Queue queue)
AmqpManagementOperationsaddQueue in interface AmqpManagementOperationsqueue - the queue.public void addQueue(String vhost, Queue queue)
AmqpManagementOperationsaddQueue in interface AmqpManagementOperationsvhost - the vhost.queue - the queue.public void deleteExchange(Exchange exchange)
AmqpManagementOperationsdeleteExchange in interface AmqpManagementOperationsexchange - the queue.public void deleteExchange(String vhost, Exchange exchange)
AmqpManagementOperationsdeleteExchange in interface AmqpManagementOperationsvhost - the vhost.exchange - the queue.public Exchange getExchange(String name)
AmqpManagementOperationsgetExchange in interface AmqpManagementOperationsname - the exchange name.public Exchange getExchange(String vhost, String name)
AmqpManagementOperationsgetExchange in interface AmqpManagementOperationsvhost - the vhost.name - the exchange name.public List<Exchange> getExchanges()
AmqpManagementOperationsgetExchanges in interface AmqpManagementOperationspublic List<Exchange> getExchanges(String vhost)
AmqpManagementOperationsDirectExchange,
FanoutExchange, HeadersExchange and TopicExchanges
are returned.getExchanges in interface AmqpManagementOperationsvhost - the vhost.public List<Binding> getBindings()
AmqpManagementOperationsgetBindings in interface AmqpManagementOperationspublic List<Binding> getBindings(String vhost)
AmqpManagementOperationsgetBindings in interface AmqpManagementOperationsvhost - the vhost.public List<Binding> getBindingsForExchange(String vhost, String exchange)
AmqpManagementOperationsgetBindingsForExchange in interface AmqpManagementOperationsvhost - the vhost.exchange - the exchange name.