Hi all,
I have a 3-node cluster, which runs RabbitMQ 3.12.10 and Erlang 26.1.2. The project requires a rather high level of availability, so we use a ha-all policy in an attempt to allow the MQTT client to connect and work with any node, regardless of the QoS settings used. Since the MQTT clients are expected to always work, regardless of whichever node is down.
If the client connects to a node with QoS0 and with the clean session bit set, the client fails to reconnect and function from another node upon node failure. An error like this appears in the RabbitMQ logs, of the new node:
2023-12-20 22:49:43.372788+08:00 [info] <0.43155.0> Accepted MQTT connection 10.105.0.18:60508 -> 10.105.0.10:1883 for client ID nodered_24e214feb018a232
2023-12-20 22:49:43.375120+08:00 [debug] <0.43155.0> Received a SUBSCRIBE for topic(s) [{mqtt_topic,
2023-12-20 22:49:43.375120+08:00 [debug] <0.43155.0> <<"as923/gateway/+/command/#">>,0}]
2023-12-20 22:49:43.376225+08:00 [error] <0.43155.0> Failed to declare queue 'mqtt-subscription-nodered_24e214feb018a232qos0' in vhost '/': {absent,
2023-12-20 22:49:43.376225+08:00 [error] <0.43155.0> {amqqueue,
2023-12-20 22:49:43.376225+08:00 [error] <0.43155.0> {resource,
2023-12-20 22:49:43.376225+08:00 [error] <0.43155.0> <<"/">>,
2023-12-20 22:49:43.376225+08:00 [error] <0.43155.0> queue,
2023-12-20 22:49:43.376225+08:00 [error] <0.43155.0> <<"mqtt-subscription-nodered_24e214feb018a232qos0">>},
2023-12-20 22:49:43.376225+08:00 [error] <0.43155.0> true,
2023-12-20 22:49:43.376225+08:00 [error] <0.43155.0> false,
2023-12-20 22:49:43.376225+08:00 [error] <0.43155.0> <15486.32690.0>,
2023-12-20 22:49:43.376225+08:00 [error] <0.43155.0> [],
2023-12-20 22:49:43.376225+08:00 [error] <0.43155.0> <15486.32690.0>,
2023-12-20 22:49:43.376225+08:00 [error] <0.43155.0> [],
2023-12-20 22:49:43.376225+08:00 [error] <0.43155.0> [],
2023-12-20 22:49:43.376225+08:00 [error] <0.43155.0> [],
2023-12-20 22:49:43.376225+08:00 [error] <0.43155.0> [{vhost,
2023-12-20 22:49:43.376225+08:00 [error] <0.43155.0> <<"/">>},
2023-12-20 22:49:43.376225+08:00 [error] <0.43155.0> {name,
2023-12-20 22:49:43.376225+08:00 [error] <0.43155.0> <<"ha-all-mqtt">>},
2023-12-20 22:49:43.376225+08:00 [error] <0.43155.0> {pattern,
2023-12-20 22:49:43.376225+08:00 [error] <0.43155.0> <<"^mqtt-">>},
2023-12-20 22:49:43.376225+08:00 [error] <0.43155.0> {'apply-to',
2023-12-20 22:49:43.376225+08:00 [error] <0.43155.0> <<"all">>},
2023-12-20 22:49:43.376225+08:00 [error] <0.43155.0> {definition,
2023-12-20 22:49:43.376225+08:00 [error] <0.43155.0> [{<<"ha-mode">>,
2023-12-20 22:49:43.376225+08:00 [error] <0.43155.0> <<"all">>}]},
2023-12-20 22:49:43.376225+08:00 [error] <0.43155.0> {priority,
2023-12-20 22:49:43.376225+08:00 [error] <0.43155.0> 0}],
2023-12-20 22:49:43.376225+08:00 [error] <0.43155.0> undefined,
2023-12-20 22:49:43.376225+08:00 [error] <0.43155.0> [],
2023-12-20 22:49:43.376225+08:00 [error] <0.43155.0> undefined,
2023-12-20 22:49:43.376225+08:00 [error] <0.43155.0> live,
2023-12-20 22:49:43.376225+08:00 [error] <0.43155.0> 0,
2023-12-20 22:49:43.376225+08:00 [error] <0.43155.0> [],
2023-12-20 22:49:43.376225+08:00 [error] <0.43155.0> <<"/">>,
2023-12-20 22:49:43.376225+08:00 [error] <0.43155.0> #{user =>
2023-12-20 22:49:43.376225+08:00 [error] <0.43155.0> <<"iottester">>},
2023-12-20 22:49:43.376225+08:00 [error] <0.43155.0> rabbit_mqtt_qos0_queue,
2023-12-20 22:49:43.376225+08:00 [error] <0.43155.0> #{}},
2023-12-20 22:49:43.376225+08:00 [error] <0.43155.0> nodedown}
2023-12-20 22:49:43.376754+08:00 [error] <0.43155.0> MQTT protocol error on connection 10.105.0.18:60508 -> 10.105.0.10:1883: subscribe_error
How do I achieve this level of HA, with the new type of queue?
Thank you for your time.