We are considering a change to the way IO handles the
retain flag on MQTT
publish packets. The retain flag is used to allow the MQTT broker to retain the
sent value, and will tell the server to pass it to any new subscribers as soon as they connect. We found that
this feature was a little hard for people to understand at first, so we decided to force the
retain flag to true for users by default. This change ensured that users always got the current state of their IO feeds
as soon as they connected, without having to send a HTTP request to the REST API for the current value.
The decision to force the retention of values caused issues with some users, because they lost the option to decide which values were cached. We are planning to revert this change, and give people the option to cache the values using the retain flag.
In addition to this change, we are thinking of extending the meaning of the retain flag, and also allowing users to decide which values are logged to the database. So for example, if you wanted to push out temperature values every second to your connected devices, but only wanted to log the temperature value every minute, you could do so by only setting the retain flag to true for the values you wish to log. This should allow for greater flexibility when logging, and will result in increased speed for feeds that are focused on realtime interaction. We welcome your feedback in the IO forum.
If you would like to read more about the MQTT retain flag, please check out this article on HiveMQ’s blog.
Here are the stats for the past week:
* 29.03 million inserts of logged data in the last 7 days * 10,969 users * 8,675 online feeds (24,277 feeds total)