I have a dynamic MQTT-in node that occasionally subscribes and then later unsubscribes. While I expected this node to receive all relevant retained messages on subscribe, it didn't initially occur to me that all other MQTT-in nodes would also re-receive their relevant retained messages.
I guess I'm just thinking out loud, because there's probably no solution where I can have the dynamic MQTT-in receive the retained messages, but not any of the other MQTT-in nodes. Does anybody have any ideas?
I actually want the node doing the dynamic sub/unsub to receive the retained messages - that's it's purpose. I sometimes screw up and accidentally let retain 'leak' from an MQTT-in to an MQTT-out (or via copy/paste of a MQTT-out node), and sometimes it causes problems. Since I always put "/retained" in the topic of any message I want to retain, this flow warns me every two hours if there's retained messages that don't have it. The purpose of the sub/unsub is largely to keep warning me until I fix it.
At this stage the only solution appears to be to not make it dynamic and build a list of warnings that is emptied on deploy/restart and keeps reminding me every 2 hours. When I delete the retained message I would then have to manually clear the list and cause the retained messages to be resent. Or maybe I just automatically delete it, reload retained messages, and send myself a warning.