I am writing my question here, because I haven’t found anything on the forum that is similar to my problem.
I am trying to set a will message (QoS 1, retained) to an mqtt out node in my flow, but apparently the Broker is not being notified about it. To be specific, when I force a disconnection (by stopping node-red), if I watch the messages on the mqtt Broker (using a different machine as an mqtt client), I don’t see the will message. However if I connect to the same Broker with the use of MQTTBox (after having set the will topic and message on it), when I disconnect from the Broker, the will message (and topic) appears on it. Am I missing something or is this the normal behavior of the mqtt out node?
Ignore me, @ukmoose is right, the LWT message is not sent on a normal shutdown. It would be if you unplugged the network for example, assuming there is a network between node red and the broker. That is how it is supposed to work according to the MQTT spec.