MQTT subscriptions fail with 'precondition_failed: invalid property 'exclusive-owner' during patching or a rolling restart.
All supported RabbitMQ versions.
When a RabbitMQ node undergoes a rolling restart or patching, MQTT clients utilizing persistent sessions lose their TCP connection. They immediately reconnect to a different, healthy node in the cluster.
By default for Qo1 subscriptions, the MQTT plugin creates backing classic queues(mqtt-subscription-xxxxqos1) that are exclusive to the connection. When the client attempts to reconnect and re-declare its subscription queue on the new node, a property mismatch occurs regarding the exclusive-owner attribute. Because exclusive classic queues cannot be declared or transferred across different nodes in this manner, RabbitMQ rejects the operation with a PRECONDITION_FAILED error.
Options to avoid the PRECONDITION_FAILED error are:
For bulk deletion of queues using a pattern a new command has been introduced. You will have to download the new tool and pick the binary for your environment.
See example below.
rabbitmqadmin --username "your_admin_user" --password "your_password" --vhost "/" queues delete_multiple --name-pattern "^mqtt-subscription-.*" --approve