Following the AMQP standard, consumers are not informed about the queue deletions. A consumer waiting for messages on a queue that is deleted will not receive any error condition and will wait there indefinitely.
However, the RabbitMQ client provides an extension that lets the consumer receive a
cancel parameter in such a case: consumer cancel notifications. We are going to see it in the example, which you can find in
To use this recipe, we need to set up the Java development environment as indicated in the Introduction section of Chapter 1, Working with AMQP.
To make this extension work, you just need to perform the following step: