@Steve-Mcl I see, you modified the code. Unfortunately I don't know how to do that yet (new to Node-Red), so I was relying on my usual bag of tricks to mess with MQTT clients. Thank you for clearing that up!
I'm working with two brokers, a local Mosquitto broker and a remote AWS IoT Core broker. I have full control over both of them. To answer your questions:
Is your connection to the broker flaky / restarting / dropping?
The connections to both are solid, but at times I was stopping the Mosquitto broker to cause disconnects in an effort to observe error behavior.
Are you changing connections & deploying often?
Yes!
Are you programmatically changing/stopping/starting broker connections (via the dynamic actions)?
No, I'm doing everything through the flow.
I don't have a lot I think it makes sense to share, but I do see the following in the docker container output even after I deleted the mqtt out
node:
5 May 19:09:46 - [info] [mqtt-broker:Mosquitto] Connected to broker: client@mqtt://10.0.1.2:1883
5 May 19:09:46 - [info] [mqtt-broker:Mosquitto] Disconnected from broker: client@mqtt://10.0.1.2:1883
5 May 19:09:46 - [info] [mqtt-broker:Mosquitto] Connected to broker: client@mqtt://10.0.1.2:1883
5 May 19:09:46 - [info] [mqtt-broker:Mosquitto] Disconnected from broker: client@mqtt://10.0.1.2:1883
5 May 19:09:47 - [info] [mqtt-broker:Amazon] Connected to broker: client@mqtts://<REMOVED>.amazonaws.com:8883
5 May 19:09:47 - [info] [mqtt-broker:Amazon] Disconnected from broker: client@mqtts://<REMOVED>.amazonaws.com:8883
5 May 19:09:47 - [info] [mqtt-broker:Amazon] Connected to broker: client@mqtts://<REMOVED>.amazonaws.com:8883
5 May 19:09:47 - [info] [mqtt-broker:Amazon] Disconnected from broker: client@mqtts://<REMOVED>.amazonaws.com:8883
During my attempts at understanding the different error handling, I created several "Servers" from the Properties page of the mqtt out
node. One for the Mosquitto broker and one for AWS IoT Core Broker. I was switching back and forth between the two and at times I would change the Connection or Security properties for a given Server. This appears to have had the side effect of creating multiple servers, all of which were attempting to connect with their respective brokers.
I tried restarting the flow, but even then I was not able to stop the behavior. Eventually I restarted the container, recreated the flow with a single Server configuration, and have not observed the previous behavior. I can attempt to recreate the issue and, if successful, provide more information. Especially since this is probably a separate problem from my original question.