While playing with MQTT in Node-RED, I accidentally configured an mqtt out
node to publish to a topic with a wildcard: topic/+
.
[{"id":"ca140429.24cef8","type":"inject","z":"3ac27de3.268a52","name":"","topic":"topic/+","payload":"","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":230,"y":140,"wires":[["ec98b238.b0cea"]]},{"id":"ec98b238.b0cea","type":"mqtt out","z":"3ac27de3.268a52","name":"","topic":"","qos":"2","retain":"true","broker":"72393540.a2a3fc","x":410,"y":140,"wires":[]},{"id":"72393540.a2a3fc","type":"mqtt-broker","z":"","name":"","broker":"localhost","port":"1883","clientid":"","usetls":false,"compatmode":false,"keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthPayload":"","closeTopic":"","closeQos":"0","closePayload":"","willTopic":"","willQos":"0","willPayload":""}]
When doing so, all MQTT in and out nodes within a project disconnected and reconnected after few seconds (causing retained messages to be injected into NR flow―which, ironically, was what I was looking for at the time). It seems to me like crashing an MQTT subsystem (?).
It doesn't look to me as intended―shouldn't mqtt out
node check and prevent publishing to topics with +
and #
by raising an error, instead of crashing (disconnecting) all MQTT nodes?