Skip to content

MQTT consumer should get disconnected when its queue is deleted #13785

Closed
@mkuratczyk

Description

@mkuratczyk

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions