#3740·mosquitto

Add an option to disconnect with Will Message

Author: scaiperCreated Sep 13, 2026Updated Sep 13, 2026
LabelsStatus: Available

MQTT 5.0 defines the Disconnect with Will Message reason code (0x04).

It would be useful if Mosquitto clients could explicitly request that the configured Will Message is published when the client sends a DISCONNECT packet.

Currently, an orderly client shutdown normally sends DISCONNECT with reason code 0x00 (Normal disconnection), which causes the broker to remove the Will Message without publishing it. As a result, applications cannot use the Will Message to notify other clients about every type of client termination.

Source: eclipse-mosquitto/mosquitto