MQTT and Node Red QOS and Retention Test Result

I suspect that this will be well understood already by most and totally logical to others without needing empirical evidence, but I wanted to share for those that are unsure of their intution about these parameters.

Question I wanted to verify the answer to:
What combination of QOS settings and Retention setting in mqtt-in and mqt-out nodes will result in outputs from the mqtt-in nodes under circumstances other shortly after data has been sent to the topic being received by an mqtt-out node?

Semi-Obvious Results:

  • QOS settings in neither the mqtt-out nor mqtt-in nodes has any impact. Regardless of any combination, a message sent in a shared topic comes through once except in circumstances I will describe for the retain flag. (Note: I am sure with some QOS settings when the connection is iffy or the MQTT server is stressed, that it may be possible to to get multiple outputs with QOS 1 (MQTT QOS explanation), but I was not able to simulated those circumstances.)

  • The retained flag which has the option of True/False/Unspecified does default to false as described in the node documentation.

  • When the retained flag is set to False, then the data only flows when the mqtt-in is connected at the time the message is sent from the mqtt-out node to the MQTT server.

  • When the retained flag is set to True, then the data does flow when the mqtt-in is connected at the time the message is sent from the mqtt-out node to the MQTT server. Additionally, it is received by the mqtt-in node when a Full Deploy Occurs, a Restart Flow is Requested, the Node Red is restarted (I restarted Node Red's Docker container), or the MQTT server is restarted (I restarted my Mosquitto Docker container).

  • When the retained flag is true, output from the mqtt-in is generated for the first node that is deployed for that topic, but not subsequent nodes with that topic. That is mqtt-in with topic a (node 1) when there is no other mqtt-in with topic a will get the retained info when added to a flow and deployed, but if a separate mqtt-in node (node 2) is the added with topic a, it won't generate output when deployed. If, however, node 1 is deployed generating output, then node 1 is deleted, then node 2 is created and deployed it does generate output upon deploy because it is effectively the first subscribing mqtt-in node for that topic.

  • Finally, less obvious to me, when I did any sort of Node Red deploy after having clicked the update button on the configuration node for my MQTT connection, it looked like a new connection to my Mosquitto MQTT server and so I got output for all retain True labelled topics. I expected this to be true if I left Client ID blank and it had been randomly generated, but it was true even when populated.

Just in case future updates makes some of this info inaccurate, it was true on June 19, 2021 with Node Red version 1.2.6 and Mosquitto version 2.0.7.

2 Likes

Shared Flows:
If you want to reuse my experimental flows, I am attaching them here:

[{"id":"7b494963.dcbb38","type":"inject","z":"296fd8cb.98ac28","name":" ","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":3030,"y":1800,"wires":[["3d93ae90.902472","1be658f7.c7a237","a4635a78.d7ff48","3ead1683.43c3aa","927c1db9.81b4f","518790dc.df85","98cbd639.7153d8","a477ed6e.e8166","7245007b.438a3","6927bee.8a1d44","cb761bcd.4e5d68","eb8aab2a.dc2048","49ff23ab.c4acfc","27b82c2c.b7eaf4","3ee7d2bc.ce461e","a9300e35.80756","12ac67a8.131ae8","3dbb14ce.3f3a7c","cb6bd487.afa798","e52ad3d.7bc973","d0b263cc.73f58","6c651bf0.b7f724","ed9f9488.ac6138","9ef63bef.52baf8","e59d9af2.1df328","6f6902cf.2d1a1c","84e34b92.819278","a008ad85.2932","65479157.43054","4223e98c.bb5ac8","55e21ae7.1ebc54","3359647f.042e7c","540aaad2.606dc4","f1d2b2a2.9595b","125ccdec.a46cf2","bcf0ecb3.280aa"]]},{"id":"469ff63.944f308","type":"group","z":"296fd8cb.98ac28","style":{"stroke":"#999999","stroke-opacity":"1","fill":"none","fill-opacity":"1","label":true,"label-position":"nw","color":"#a4a4a4"},"nodes":["3546d6d7.c219aa","71ca4c82.593104","de43bf35.bfcab","d66cf8f3.f44c68","e59d9af2.1df328","c60b9099.82195","d24cd7e3.e34c08","65e952e3.f655bc","6dce15b5.69c8dc","6f6902cf.2d1a1c","33d7004.318ef","271c7497.69446c","965f6d65.66986","dbbf3ad6.1d3808","84e34b92.819278","3c1504c7.569f0c","2065b76.de8a448","b398f71b.63d648","d1f4f6c1.020f98","a008ad85.2932","ad144dba.2348","2439ba53.267fd6","6f442bcd.63ed44","a157fbd4.b347d8","65479157.43054","2db237d4.16cc48","507fe031.c445a","23240cbe.b0a744","a4f919af.a09fe8","4223e98c.bb5ac8","10c41bed.2c6d44","926b3b81.8755e8","664b79ca.61e628","40933f6a.257b1","55e21ae7.1ebc54","7caeacd4.425934","51ca58f1.bc2a98","b077713a.76b","bc35d0bb.54dd3","3359647f.042e7c","bf8f8a62.0762a8","1836b52a.a8042b","ddbafaf4.2971c8","e16a7249.eb545","540aaad2.606dc4","d06fb71.bfeb948","443b6e3b.29eac","cf73870c.ccfa08","6fe2d1c9.e518","f1d2b2a2.9595b","66bac2b9.a8606c","b92e9f02.c0d9e","125ccdec.a46cf2","44eeb5f.758924c","b09b174d.61dac8","247f0722.30c3d8","c1fde4aa.717f88","bcf0ecb3.280aa","6b019bcc.d6b9c4","12f0e56b.c1fc6b"],"x":3104,"y":59,"w":1162,"h":1462},{"id":"3546d6d7.c219aa","type":"mqtt in","z":"296fd8cb.98ac28","g":"469ff63.944f308","name":"","topic":"Test/Out QOS-Blank-Out Retain-Blank-In QOS-0","qos":"0","datatype":"auto","broker":"3e475068.ad3bc","x":3600,"y":160,"wires":[["de43bf35.bfcab"]]},{"id":"71ca4c82.593104","type":"mqtt out","z":"296fd8cb.98ac28","g":"469ff63.944f308","name":"","topic":"Test/Out QOS-Blank-Out Retain-Blank-In QOS-0","qos":"","retain":"","broker":"3e475068.ad3bc","x":3610,"y":100,"wires":[]},{"id":"de43bf35.bfcab","type":"debug","z":"296fd8cb.98ac28","g":"469ff63.944f308","name":"Test/Out QOS-Blank-Out Retain-Blank-In QOS-0","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":4030,"y":160,"wires":[]},{"id":"d66cf8f3.f44c68","type":"inject","z":"296fd8cb.98ac28","g":"469ff63.944f308","name":" ","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":3200,"y":100,"wires":[["e59d9af2.1df328"]]},{"id":"e59d9af2.1df328","type":"change","z":"296fd8cb.98ac28","g":"469ff63.944f308","name":"25","rules":[{"t":"set","p":"payload","pt":"msg","to":"{\t    \"payload\": msg.payload & \" #25\"   \t}","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":3350,"y":100,"wires":[["71ca4c82.593104"]]},{"id":"c60b9099.82195","type":"mqtt in","z":"296fd8cb.98ac28","g":"469ff63.944f308","name":"","topic":"Test/Out QOS-Blank-Out Retain-TRUE-In QOS-0","qos":"0","datatype":"auto","broker":"3e475068.ad3bc","x":3600,"y":280,"wires":[["65e952e3.f655bc"]]},{"id":"d24cd7e3.e34c08","type":"mqtt out","z":"296fd8cb.98ac28","g":"469ff63.944f308","name":"","topic":"Test/Out QOS-Blank-Out Retain-TRUE-In QOS-0","qos":"","retain":"true","broker":"3e475068.ad3bc","x":3610,"y":220,"wires":[]},{"id":"65e952e3.f655bc","type":"debug","z":"296fd8cb.98ac28","g":"469ff63.944f308","name":"Test/Out QOS-Blank-Out Retain-TRUE-In QOS-0","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":4030,"y":280,"wires":[]},{"id":"6dce15b5.69c8dc","type":"inject","z":"296fd8cb.98ac28","g":"469ff63.944f308","name":" ","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":3200,"y":220,"wires":[["6f6902cf.2d1a1c"]]},{"id":"6f6902cf.2d1a1c","type":"change","z":"296fd8cb.98ac28","g":"469ff63.944f308","name":"26","rules":[{"t":"set","p":"payload","pt":"msg","to":"{\t    \"payload\": msg.payload & \" #26\"   \t}","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":3350,"y":220,"wires":[["d24cd7e3.e34c08"]]},{"id":"33d7004.318ef","type":"mqtt in","z":"296fd8cb.98ac28","g":"469ff63.944f308","name":"","topic":"Test/Out QOS-Blank-Out Retain-FALSE-In QOS-0","qos":"0","datatype":"auto","broker":"3e475068.ad3bc","x":3610,"y":400,"wires":[["965f6d65.66986"]]},{"id":"271c7497.69446c","type":"mqtt out","z":"296fd8cb.98ac28","g":"469ff63.944f308","name":"","topic":"Test/Out QOS-Blank-Out Retain-FALSE-In QOS-0","qos":"","retain":"false","broker":"3e475068.ad3bc","x":3610,"y":340,"wires":[]},{"id":"965f6d65.66986","type":"debug","z":"296fd8cb.98ac28","g":"469ff63.944f308","name":"Test/Out QOS-Blank-Out Retain-FALSE-In QOS-0","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":4030,"y":400,"wires":[]},{"id":"dbbf3ad6.1d3808","type":"inject","z":"296fd8cb.98ac28","g":"469ff63.944f308","name":" ","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":3200,"y":340,"wires":[["84e34b92.819278"]]},{"id":"84e34b92.819278","type":"change","z":"296fd8cb.98ac28","g":"469ff63.944f308","name":"27","rules":[{"t":"set","p":"payload","pt":"msg","to":"{\t    \"payload\": msg.payload & \" #27\"   \t}","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":3350,"y":340,"wires":[["271c7497.69446c"]]},{"id":"3c1504c7.569f0c","type":"mqtt in","z":"296fd8cb.98ac28","g":"469ff63.944f308","name":"","topic":"Test/Out QOS-0-Out Retain-Blank-In QOS-0","qos":"0","datatype":"auto","broker":"3e475068.ad3bc","x":3590,"y":520,"wires":[["b398f71b.63d648"]]},{"id":"2065b76.de8a448","type":"mqtt out","z":"296fd8cb.98ac28","g":"469ff63.944f308","name":"","topic":"Test/Out QOS-0-Out Retain-Blank-In QOS-0","qos":"0","retain":"","broker":"3e475068.ad3bc","x":3590,"y":460,"wires":[]},{"id":"b398f71b.63d648","type":"debug","z":"296fd8cb.98ac28","g":"469ff63.944f308","name":"Test/Out QOS-0-Out Retain-Blank-In QOS-0","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":4010,"y":520,"wires":[]},{"id":"d1f4f6c1.020f98","type":"inject","z":"296fd8cb.98ac28","g":"469ff63.944f308","name":" ","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":3200,"y":460,"wires":[["a008ad85.2932"]]},{"id":"a008ad85.2932","type":"change","z":"296fd8cb.98ac28","g":"469ff63.944f308","name":"28","rules":[{"t":"set","p":"payload","pt":"msg","to":"{\t    \"payload\": msg.payload & \" #28\"   \t}","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":3350,"y":460,"wires":[["2065b76.de8a448"]]},{"id":"ad144dba.2348","type":"mqtt in","z":"296fd8cb.98ac28","g":"469ff63.944f308","name":"","topic":"Test/Out QOS-0-Out Retain-TRUE-In QOS-0","qos":"0","datatype":"auto","broker":"3e475068.ad3bc","x":3590,"y":640,"wires":[["6f442bcd.63ed44"]]},{"id":"2439ba53.267fd6","type":"mqtt out","z":"296fd8cb.98ac28","g":"469ff63.944f308","name":"","topic":"Test/Out QOS-0-Out Retain-TRUE-In QOS-0","qos":"0","retain":"true","broker":"3e475068.ad3bc","x":3590,"y":580,"wires":[]},{"id":"6f442bcd.63ed44","type":"debug","z":"296fd8cb.98ac28","g":"469ff63.944f308","name":"Test/Out QOS-0-Out Retain-TRUE-In QOS-0","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":4010,"y":640,"wires":[]},{"id":"a157fbd4.b347d8","type":"inject","z":"296fd8cb.98ac28","g":"469ff63.944f308","name":" ","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":3200,"y":580,"wires":[["65479157.43054"]]},{"id":"65479157.43054","type":"change","z":"296fd8cb.98ac28","g":"469ff63.944f308","name":"29","rules":[{"t":"set","p":"payload","pt":"msg","to":"{\t    \"payload\": msg.payload & \" #29\"   \t}","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":3350,"y":580,"wires":[["2439ba53.267fd6"]]},{"id":"2db237d4.16cc48","type":"mqtt in","z":"296fd8cb.98ac28","g":"469ff63.944f308","name":"","topic":"Test/Out QOS-0-Out Retain-FALSE-In QOS-0","qos":"0","datatype":"auto","broker":"3e475068.ad3bc","x":3590,"y":760,"wires":[["23240cbe.b0a744"]]},{"id":"507fe031.c445a","type":"mqtt out","z":"296fd8cb.98ac28","g":"469ff63.944f308","name":"","topic":"Test/Out QOS-0-Out Retain-FALSE-In QOS-0","qos":"0","retain":"false","broker":"3e475068.ad3bc","x":3600,"y":700,"wires":[]},{"id":"23240cbe.b0a744","type":"debug","z":"296fd8cb.98ac28","g":"469ff63.944f308","name":"Test/Out QOS-0-Out Retain-FALSE-In QOS-0","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":4020,"y":760,"wires":[]},{"id":"a4f919af.a09fe8","type":"inject","z":"296fd8cb.98ac28","g":"469ff63.944f308","name":" ","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":3200,"y":700,"wires":[["4223e98c.bb5ac8"]]},{"id":"4223e98c.bb5ac8","type":"change","z":"296fd8cb.98ac28","g":"469ff63.944f308","name":"30","rules":[{"t":"set","p":"payload","pt":"msg","to":"{\t    \"payload\": msg.payload & \" #30\"   \t}","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":3350,"y":700,"wires":[["507fe031.c445a"]]},{"id":"10c41bed.2c6d44","type":"mqtt in","z":"296fd8cb.98ac28","g":"469ff63.944f308","name":"","topic":"Test/Out QOS-1-Out Retain-Blank-In QOS-0","qos":"0","datatype":"auto","broker":"3e475068.ad3bc","x":3590,"y":880,"wires":[["664b79ca.61e628"]]},{"id":"926b3b81.8755e8","type":"mqtt out","z":"296fd8cb.98ac28","g":"469ff63.944f308","name":"","topic":"Test/Out QOS-1-Out Retain-Blank-In QOS-0","qos":"1","retain":"","broker":"3e475068.ad3bc","x":3590,"y":820,"wires":[]},{"id":"664b79ca.61e628","type":"debug","z":"296fd8cb.98ac28","g":"469ff63.944f308","name":"Test/Out QOS-1-Out Retain-Blank-In QOS-0","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":4010,"y":880,"wires":[]},{"id":"40933f6a.257b1","type":"inject","z":"296fd8cb.98ac28","g":"469ff63.944f308","name":" ","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":3200,"y":820,"wires":[["55e21ae7.1ebc54"]]},{"id":"55e21ae7.1ebc54","type":"change","z":"296fd8cb.98ac28","g":"469ff63.944f308","name":"31","rules":[{"t":"set","p":"payload","pt":"msg","to":"{\t    \"payload\": msg.payload & \" #31\"   \t}","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":3350,"y":820,"wires":[["926b3b81.8755e8"]]},{"id":"7caeacd4.425934","type":"mqtt in","z":"296fd8cb.98ac28","g":"469ff63.944f308","name":"","topic":"Test/Out QOS-1-Out Retain-TRUE-In QOS-0","qos":"0","datatype":"auto","broker":"3e475068.ad3bc","x":3590,"y":1000,"wires":[["b077713a.76b"]]},{"id":"51ca58f1.bc2a98","type":"mqtt out","z":"296fd8cb.98ac28","g":"469ff63.944f308","name":"","topic":"Test/Out QOS-1-Out Retain-TRUE-In QOS-0","qos":"1","retain":"true","broker":"3e475068.ad3bc","x":3590,"y":940,"wires":[]},{"id":"b077713a.76b","type":"debug","z":"296fd8cb.98ac28","g":"469ff63.944f308","name":"Test/Out QOS-1-Out Retain-TRUE-In QOS-0","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":4010,"y":1000,"wires":[]},{"id":"bc35d0bb.54dd3","type":"inject","z":"296fd8cb.98ac28","g":"469ff63.944f308","name":" ","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":3200,"y":940,"wires":[["3359647f.042e7c"]]},{"id":"3359647f.042e7c","type":"change","z":"296fd8cb.98ac28","g":"469ff63.944f308","name":"32","rules":[{"t":"set","p":"payload","pt":"msg","to":"{\t    \"payload\": msg.payload & \" #32\"   \t}","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":3350,"y":940,"wires":[["51ca58f1.bc2a98"]]},{"id":"bf8f8a62.0762a8","type":"mqtt in","z":"296fd8cb.98ac28","g":"469ff63.944f308","name":"","topic":"Test/Out QOS-1-Out Retain-FALSE-In QOS-0","qos":"0","datatype":"auto","broker":"3e475068.ad3bc","x":3590,"y":1120,"wires":[["ddbafaf4.2971c8"]]},{"id":"1836b52a.a8042b","type":"mqtt out","z":"296fd8cb.98ac28","g":"469ff63.944f308","name":"","topic":"Test/Out QOS-1-Out Retain-FALSE-In QOS-0","qos":"1","retain":"false","broker":"3e475068.ad3bc","x":3600,"y":1060,"wires":[]},{"id":"ddbafaf4.2971c8","type":"debug","z":"296fd8cb.98ac28","g":"469ff63.944f308","name":"Test/Out QOS-1-Out Retain-FALSE-In QOS-0","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":4020,"y":1120,"wires":[]},{"id":"e16a7249.eb545","type":"inject","z":"296fd8cb.98ac28","g":"469ff63.944f308","name":" ","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":3200,"y":1060,"wires":[["540aaad2.606dc4"]]},{"id":"540aaad2.606dc4","type":"change","z":"296fd8cb.98ac28","g":"469ff63.944f308","name":"33","rules":[{"t":"set","p":"payload","pt":"msg","to":"{\t    \"payload\": msg.payload & \" #33\"   \t}","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":3350,"y":1060,"wires":[["1836b52a.a8042b"]]},{"id":"d06fb71.bfeb948","type":"mqtt in","z":"296fd8cb.98ac28","g":"469ff63.944f308","name":"","topic":"Test/Out QOS-2-Out Retain-Blank-In QOS-0","qos":"0","datatype":"auto","broker":"3e475068.ad3bc","x":3590,"y":1240,"wires":[["cf73870c.ccfa08"]]},{"id":"443b6e3b.29eac","type":"mqtt out","z":"296fd8cb.98ac28","g":"469ff63.944f308","name":"","topic":"Test/Out QOS-2-Out Retain-Blank-In QOS-0","qos":"2","retain":"","broker":"3e475068.ad3bc","x":3590,"y":1180,"wires":[]},{"id":"cf73870c.ccfa08","type":"debug","z":"296fd8cb.98ac28","g":"469ff63.944f308","name":"Test/Out QOS-2-Out Retain-Blank-In QOS-0","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":4010,"y":1240,"wires":[]},{"id":"6fe2d1c9.e518","type":"inject","z":"296fd8cb.98ac28","g":"469ff63.944f308","name":" ","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":3200,"y":1180,"wires":[["f1d2b2a2.9595b"]]},{"id":"f1d2b2a2.9595b","type":"change","z":"296fd8cb.98ac28","g":"469ff63.944f308","name":"34","rules":[{"t":"set","p":"payload","pt":"msg","to":"{\t    \"payload\": msg.payload & \" #34\"   \t}","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":3350,"y":1180,"wires":[["443b6e3b.29eac"]]},{"id":"66bac2b9.a8606c","type":"mqtt out","z":"296fd8cb.98ac28","g":"469ff63.944f308","name":"","topic":"Test/Out QOS-2-Out Retain-TRUE-In QOS-0","qos":"2","retain":"true","broker":"3e475068.ad3bc","x":3590,"y":1300,"wires":[]},{"id":"b92e9f02.c0d9e","type":"inject","z":"296fd8cb.98ac28","g":"469ff63.944f308","name":" ","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":3200,"y":1300,"wires":[["125ccdec.a46cf2"]]},{"id":"125ccdec.a46cf2","type":"change","z":"296fd8cb.98ac28","g":"469ff63.944f308","name":"35","rules":[{"t":"set","p":"payload","pt":"msg","to":"{\t    \"payload\": msg.payload & \" #35\"   \t}","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":3350,"y":1300,"wires":[["66bac2b9.a8606c"]]},{"id":"44eeb5f.758924c","type":"mqtt in","z":"296fd8cb.98ac28","g":"469ff63.944f308","name":"","topic":"Test/Out QOS-2-Out Retain-FALSE-In QOS-0","qos":"0","datatype":"auto","broker":"3e475068.ad3bc","x":3590,"y":1480,"wires":[["247f0722.30c3d8"]]},{"id":"b09b174d.61dac8","type":"mqtt out","z":"296fd8cb.98ac28","g":"469ff63.944f308","name":"","topic":"Test/Out QOS-2-Out Retain-FALSE-In QOS-0","qos":"2","retain":"false","broker":"3e475068.ad3bc","x":3600,"y":1420,"wires":[]},{"id":"247f0722.30c3d8","type":"debug","z":"296fd8cb.98ac28","g":"469ff63.944f308","name":"Test/Out QOS-2-Out Retain-FALSE-In QOS-0","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":4020,"y":1480,"wires":[]},{"id":"c1fde4aa.717f88","type":"inject","z":"296fd8cb.98ac28","g":"469ff63.944f308","name":" ","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":3200,"y":1420,"wires":[["bcf0ecb3.280aa"]]},{"id":"bcf0ecb3.280aa","type":"change","z":"296fd8cb.98ac28","g":"469ff63.944f308","name":"36","rules":[{"t":"set","p":"payload","pt":"msg","to":"{\t    \"payload\": msg.payload & \" #36\"   \t}","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":3350,"y":1420,"wires":[["b09b174d.61dac8"]]},{"id":"6b019bcc.d6b9c4","type":"mqtt in","z":"296fd8cb.98ac28","g":"469ff63.944f308","name":"","topic":"Test/Out QOS-2-Out Retain-TRUE-In QOS-0","qos":"0","datatype":"auto","broker":"3e475068.ad3bc","x":3590,"y":1360,"wires":[["12f0e56b.c1fc6b"]]},{"id":"12f0e56b.c1fc6b","type":"debug","z":"296fd8cb.98ac28","g":"469ff63.944f308","name":"Test/Out QOS-2-Out Retain-TRUE-In QOS-0","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":4010,"y":1360,"wires":[]},{"id":"3e475068.ad3bc","type":"mqtt-broker","name":"ntpi1f-MQTT","broker":"ntpi1f","port":"1883","clientid":"ntpi1f-NR","usetls":false,"compatmode":false,"keepalive":"60","cleansession":true,"birthTopic":"ntpi1fnodered/status","birthQos":"2","birthRetain":"false","birthPayload":"Online","closeTopic":"ntpi1fnodered/status","closeQos":"2","closeRetain":"false","closePayload":"Offline-Closed","willTopic":"ntpi1fnodered/status","willQos":"2","willRetain":"false","willPayload":"Offline-Lost"}]

Just import and then update the MQTT server with your servers info.

One note, I actually did 3 versions of this with different numbers in the change nodes and different QOS values, but the flow with all 36 combinations was larger than I was allow to post so I only included QOS 0 for the mqtt-in nodes here.

Hi @tmichaeltx - some good info for those new to MQTT and wanting to understand some of the mechanics of how node-red handles things. Cheers.

When a configuration node (or pretty much any node) is modified, in simple terms, that node is closed and recreated. So what you are seeing is the MQTT connection closed and re-opened.