Configuring a queue

Now, we will configure a queue using the Queue class. The following code creates a queue with a specific name:

@Beanpublic Queue queue() {    return new Queue(RABBIT_MESSAGE_QUEUE, true);}

The preceding queue() method creates an AMQP queue with a specific name declared using the RABBIT_MESSAGE_QUEUE constant. We can also set the durability using the durable flag. We need to pass it along with the second constructor argument as a Boolean type.

Get Hands-On High Performance with Spring 5 now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.