Share this post:
There’s a change coming up in the Watson IoT Platform that affects devices, gateways and applications if they’re disconnected for an extended period of time.
When a device connects to the platform over MQTT, it can ask the platform to collect commands and actions for it while it’s disconnected. It does that by setting CleanSession = false (i.e. don’t clean/throw away my session). The platform remembers the subscriptions that the device has made. This information together with the status of inflight messages make up the client state maintained by the platform.
While the device is disconnected, messages for it build up and when it reconnects they’re delivered to the device.
For devices that are broken, or fail to reconnect, it’s possible for messages to build up that may never be delivered.
This is also true for other things that connect to the platform and make MQTT subscriptions like gateways and applications. Applications, especially, can build up large numbers of event messages.
To prevent that from happening, we’re introducing a change to the Watson IOT Platform: The session will be removed after the device, gateway or application has been disconnected and inactive for 45 days.
If reconnect does happen after 45 days, the Session Present flag will be set to false in the MQTT message to let you know the session has expired.
This change will take effect on or after April 5, 2017.