I'm using Paho Java client currently, is it possible to trigger the broker to send the will message in code? since using disconnect() will not result in a will message being sent by the broker
Try to kill client pid form terminal. This should trigger LWT after standard MQTT timeouts.
-1
votes
No, that's not how the LWT works.
The broker will only publish the LWT if the client times out (or the socket drops) without the client sending a disconnect message.
There is nothing to stop you manually publishing the same message before calling disconnect()
We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it.OkRead more