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.