Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Coming soon…The purpose of this document is to show how to configure a ClearBlade system so that IF an MQTT client disconnected ungracefully (e.g. because of a catastrophic power-cycle) THEN the system would store messages being sent to the disconnected device and deliver them when the device reconnects.

PREREQUISITES:

  1. The environment is running ClearBlade Platform Version >= 9.33.4.

  2. The ClearBlade console is available for viewing / editing systems (note for ClearBlade IoTCore users: behind a registry there is a system):

    image-20240227-203021.pngImage Added
  3. Devices have connected with persistent sessions, typically enforced by setting a clean or clean_session flag to FALSE when connecting with the MQTT library of your choice (e.g. paho.mqtt.python).

  4. Devices have subscribed to the topics for which they would like messages stored in case of a catastrophic disconnect with QoS (Quality of Service) 1 or 2.

STEPS:

  1. Go to the Messages page on the console and then choose the History Storage tab:

    image-20240227-203859.pngImage Added

    image-20240227-203952.pngImage Added

    image-20240227-204314.pngImage Added

    Note to ClearBlade IoTCore users: there will be an existing item in History Storage for topic /devices/+/state. DO NOT EDIT OR DELETE THAT ITEM.

  2. Click Add Topic and configure the History Storage item:

    image-20240227-204623.pngImage Added
    1. Enter the topic for which message history should be stored. Use wildcards + and # as appropriate for MQTT topics. e.g. /devices/+/commands/#

    2. Check the Platform (i.e. cloud) and/or Edge checkboxes as appropriate. It does not hurt to have both checked if only one is used. For most customers Messages only need to be stored on the Platform.

    3. Set a value for Max Rows. We highly recommend to NOT set this to Infinite! Set this to a maximum number of messages to store beyond the benefit of storing messages is diminished.

    4. Set a value for Max Time. We highly recommended to NOT set this to Forever. Set this to a maximum time beyond which a reconnecting device SHOULD be treated as a newly connecting device.