Retain LastWill
See original GitHub issueUsing M2Mqtt as a client that connects with willRetain flag ON, does not retain the message.
//ID, User, Pass, WillRetain, WillQoS, WillFlag, WillTopic, WillMessage, Clean, KeepAlive
client.Connect(clientID, null, null, true, MqttMsgBase.QOS_LEVEL_AT_LEAST_ONCE, true, "State/lastWill", "online", true, 3);
Issue Analytics
- State:
- Created 7 years ago
- Comments:9 (3 by maintainers)
Top Results From Across the Web
What is MQTT Last Will and Testament (LWT)?
It becomes a powerful tool for storing and communicating client state on specific topics when combined with retained messages. For instance, by ...
Read more >MQTT Last Will Explained + Example
'Last will and testament' is a legal document that determines how the person's possessions will be distributed in the event of death. 'Will...
Read more >MQTT Last Will and Testament Use and Examples
The last will and testament message is used to notify subscribers of an unexpected shut down of the publisher. Here we look at...
Read more >Where to store a last will
The most important thing to remember is, no matter where you decide to keep the original copy of your will, to tell your...
Read more >MQTT what is the purpose or usage of Last Will Testament?
The Last Will and Testament feature is used in MQTT to notify other clients about an ungracefully disconnected client. MQTT is often used...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Hi, I had the same problem. If you publish a message before connecting to the Broker, the value is never published. I added a wrapper in my program around M2Mqtt to store the messages and values in a dictionary. Then OnConnect I re-publish automatically the last messages/values automatically. Then it works. It would be great to add this feature in M2Mqtt library. Regards
You are correct. This broker needs an update.