cumulusmx / CumulusMX

The CumulusMX weather program
GNU General Public License v3.0
82 stars 23 forks source link

Enabled retained flag MQTT #86

Closed davide93 closed 3 years ago

davide93 commented 3 years ago

Retained messages help newly-subscribed clients get a status update immediately after they subscribe to a topic. The retained message eliminates the wait for the publishing clients to send the next update.

More info: https://www.hivemq.com/blog/mqtt-essentials-part-8-retained-messages/

Forum topic: https://cumulus.hosiene.co.uk/viewtopic.php?f=36&t=18488

mcrossley commented 3 years ago

True, but it also means that they may get stale data if MX is not currently running or updating MQTT for some reason.

davide93 commented 3 years ago

As I've said on the forum... It depends on the type of application in which MQTT is used. In my case, using MQTT in a * application turns out to be convenient to have last available data immediately showed to client and eventually check the time of the last data received throught a script. Surely it could be implemented with a checkbox.

mcrossley commented 3 years ago

Hi, I have implemented the retained flag in the next release, but I have done it via the configuration settings and it is optional. Thanks for the suggestion.

davide93 commented 3 years ago

That's great! Thank you for the work.