To simplify the offline message fetching mechanism, Message Queue for MQTTafter the connection to a client is established and the system passes the authentication, the offline messages are automatically loaded and delivered to the client.

Precautions

  • After the MQTT client establishes a connection, it must pass the permission verification to automatically load offline messages. For example, if you use token verification for an MQTT client, you must upload the token and the MQTT client must pass the verification before it can receive offline messages.
  • An offline message takes some time to generate, because the pushed message can be judged as an offline message after the MQTT client acknowledgement times out. Therefore, if the MQTT client experiences transient disconnection and reconnection, you may not be able to obtain the offline notification message immediately. The latency ranges from 5 seconds to 10 seconds.
  • If you have too many offline messages, that is, more than 30 messages, Message Queue for MQTTthe system sends offline messages in batches (once every 5 seconds, 30 at a time).
Note The automatic loading mechanism allows you to replace the original active pulling method for retrieving offline messages, though you can still use the original method.

Configuration method

You need to set QoS and cleanSession two parameters are used to determine whether to obtain offline messages. For more information, see Terms.