The Losant broker does not support retained messages. The reason is similar to why it doesn’t support cleansession=0
: it’s a data buffering challenge when retaining even a small amount of data a very large number of devices. Certainly a technical challenge we’d like to solve, but not one we’ve solved yet - at least in a way that meets our scalability and performance requirements.
That said, we do store commands sent to devices, which are available via the API. The commands will be available in the history based on your organizations data retention limit.
An implementation I’ve seen successfully deployed is that a device will request its command history each time it reboots or reconnects. A device can authenticate against the API using its own access key and secret. This allows a device to request its own command history from the API.
Another option is to send the most recent command to a device from a cloud workflow each time the device connects.
- On Connect Trigger
- Losant API Node to request most recent command
- Publish command to custom MQTT topic