public class RabbitQueueFactoryImpl extends Object implements RabbitQueueFactory
| Modifier and Type | Field and Description |
|---|---|
private com.rabbitmq.client.Connection |
connection |
| Constructor and Description |
|---|
RabbitQueueFactoryImpl(com.rabbitmq.client.Connection connection) |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
com.rabbitmq.client.Channel |
createChannel()
This method opens a channel using the established connection to RabbitMQ.
|
RabbitQueue |
createDefaultRabbitQueue(String name)
This method opens a channel using the established connection to RabbitMQ
and creates a new queue using the given name and the following
configuration:
The channel number is automatically derived from the connection.
The queue is not durable.
The queue is not exclusive.
The queue is configured to be deleted automatically.
No additional queue configuration is defined.
|
RabbitQueue |
createDefaultRabbitQueue(String name,
com.rabbitmq.client.Channel channel)
This method uses the given channel and creates a new queue using the
given name and the following configuration:
The queue is not durable.
The queue is not exclusive.
The queue is configured to be deleted automatically.
No additional queue configuration is defined.
|
com.rabbitmq.client.Connection |
getConnection()
Returns the
Connection to the RabbitMQ broker used internally. |
public RabbitQueueFactoryImpl(com.rabbitmq.client.Connection connection)
public RabbitQueue createDefaultRabbitQueue(String name) throws IOException
RabbitQueueFactorycreateDefaultRabbitQueue in interface RabbitQueueFactoryname - name of the queueRabbitQueue object comprising the Channel and the
name of the created queueIOException - if a communication problem during the creation of the channel
or the queue occurspublic com.rabbitmq.client.Connection getConnection()
RabbitQueueFactoryConnection to the RabbitMQ broker used internally.getConnection in interface RabbitQueueFactoryConnection to the RabbitMQ broker used internallypublic void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableIOExceptionpublic RabbitQueue createDefaultRabbitQueue(String name, com.rabbitmq.client.Channel channel) throws IOException
RabbitQueueFactorycreateDefaultRabbitQueue in interface RabbitQueueFactoryname - name of the queuechannel - the Channel that will be used to generate the queueRabbitQueue object comprising the Channel and the
name of the created queueIOException - if a communication problem during the creation of the channel
or the queue occurspublic com.rabbitmq.client.Channel createChannel()
throws IOException
RabbitQueueFactorycreateChannel in interface RabbitQueueFactoryChannelIOException - if a communication problem during the creation of the channelCopyright © 2017–2018. All rights reserved.