New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Last Will not working? #1990
Comments
In the sample the client gets disconnected properly by calling DisconnectAsync. This will indicate a clean disconnect. The last will ist only published if the client is disconnected in a non clean way. This means losing network connection or a crashing application. You can also try to make in non clean by avoiding the call of DisconnectAsync and instead calling Dispose. Or you simply close your application 😄 |
I did test that behaviour and came to the same conclusion this weekend. Working for years with MQTT applications that run 24/7 i never noticed that the LW is only triggered on an ungracefull disconnect, because i do only get those. :) Thanks for the reminder! |
Describe your question
Im Currently testing LW and cant get it working.
Which project is your question related to?
Im currently testing with this example
I have extended the Optionsbuilder for credentials and last will. The credentials are working fine, but LW seems to not work.
Am i missing a OptionsBuilder parameter or is something off in general?
The program sends 0-9 with these OptionsBuilder settings, but my "test/LW" topic does not get changed.
Im also Testing with Retained and clearing - noted here, to explain the 3rd screenshots with "missing" topic ;)
Initial Subscription
in the middle of my test-run:
10 min. after the test:
if i test it with another subscriber i get the same result:
run 1
run 2 to verify that the normal messages do work
a Wireshark trace seems to be okay aswell.
Other applications of mine do offer a working LW retained message
i did start a test-instance of mosquitto to check if there are problems with my Test-broker, that did also not help.
Thanks for your help and have a nice week
Schoschy
The text was updated successfully, but these errors were encountered: