Closed
Description
Describe the bug
Queues are automatically declared for MQTT consumers. Currently we assume they don't get deleted externally (eg. manually by a user) but technically they can be. The consumer should be disconnected in such case, because it has no way of knowing this happened - from its perspective there are simply no messages to consume.
In RabbitMQ 3.11 the consumer was disconnected in such situations because that's what AMQP does. This behaviour changed with native MQTT, which doesn't use AMQP internally.
Reproduction steps
> omq mqtt -r 1
...
2025/04/24 09:47:02 published=1/s consumed=1/s
2025/04/24 09:47:03 published=1/s consumed=1/s
2025/04/24 09:47:04 published=1/s consumed=1/s
2025/04/24 09:47:05 published=1/s consumed=1/s
2025/04/24 09:47:06 published=1/s consumed=1/s
2025/04/24 09:47:07 published=1/s consumed=0/s <---- rabbitmqct delete_queue ...
2025/04/24 09:47:08 published=1/s consumed=0/s
2025/04/24 09:47:09 published=1/s consumed=0/s
Expected behavior
When a queue declared for an MQTT consumer is deleted, the consumer should be disconnected.
Additional context
No response