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 the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.