- Più recenti
- Maggior numero di voti
- Maggior numero di commenti
After updating to the latest Nucleus and client libraries we are no longer seeing this issue. Closing.
Hi. Are you trying to get the LWT received at AWS IoT Core? Or just by other clients connected to the Moquette broker?
If the former, then you need to have setup the MQTT Bridge config for the LWT topic, as you perhaps already know.
How long are you waiting for LWT message? Do you have other keep-alive settings, etc, set? I just performed a an experiement where I blocked port 8883 from a client and LWT was sent sometime after
We have waited upwards of 10 minutes after disconnecting the client's Ethernet cable. The only keep alive setting that we're actively setting is
keep_alive_secs=6
. Are you testing with any other non-default settings? Can you try disconnecting the client's network connection instead of blocking the port server-side? Not sure if that will result in different behavior.Used same connection settings, but with a 30 second keep alive. Would you mind sharing snippet of code for your client that's subscribed to the will topic?
Just re-read everything, didn't realize bridge was in between. So just to clarify, you have client --> bridge --> iot core. And for will message are you subscribed to iot core or bridge?
Correct: client -> bridge -> core. We know everything is configured correctly since we get the LWT message (via IoT Core) on graceful disconnect. It's really only when we pull the Eth cord that it doesn't fire.
All of our client code is posted above in the main question. Were you looking for something else in particular?
Thank you!
Contenuto pertinente
- AWS UFFICIALEAggiornata 2 anni fa
What do you mean that nothing fires? If LWT is being sent upon disconnect, then that's working properly.
@MichaelDombrowski-AWS sorry, my comment above was unclear. LWT is being sent on disconnect if I kill the process. LWT is not being sent on timeout-based disconnect, i.e. I pull the Ethernet cord. This is 100% reproducible.
Correct, we have the bridge setup to forward to IoT Core. We know this is working correctly, as we get successful
disconnect
messages on graceful disconnect. It's only when the client disconnects via timeout (pulling the Eth cable) that nothing fires.I'd recommend that you use the EMQX broker in this case. Moquette should be working, but it is certainly possible that something is going wrong there.
Switching brokers is not really trivial for us due to the nature of the products we build. Can AWS confirm this functionality exists in the EMQX broker? Can AWS confirm this is an existing bug w/ the Moquette component? Perhaps there's an upstream fix there?