Changing LWT via Plugin

Skip to first unread message

Richard Earl

Jul 1, 2022, 10:29:57 AM7/1/22
to vernemq-users
I have a requirement to be able to change the user properties on a Last Will and Testament message, is this something that is possible to do via plugin?

Essentially I need to be able to send what time a client has gone offline and online. When the client connects, we send a timestamp along in the user property, which works fine.

For going offline, if we set a timestamp in the LWT this would be at the time the client connected (as this is when it would be resolved), not when it disconnected. The only solution I can think of is to use plugins in vernemq to set the timestamp in the properties of the LWT before it sends it out. Is this possible? if so which hook would we need to use?

Thank you
Reply all
Reply to author
0 new messages