MQ for MQTT imposes restrictions and specifications on certain metrics. When using MQ for MQTT, to avoid application errors, ensure that the relevant limits are not exceeded. The following table lists the limits imposed by MQ for MQTT.

If you are using MQ for MQTT Enterprise Platinum Edition, you can customize some metrics as needed (marked in the following table). For more information, submit a ticket.

Table 1. Limits on using MQ for MQTT
Item Threshold Description
Topic length 64 characters The topic length cannot exceed 64 characters when MQ for MQTT is used for sending and receiving messages. Otherwise, you may fail to send or subscribe to messages.
Characters available for topics and client IDs Digits 0-9, letters a-z or A-Z, hyphen (-), and underscore (_) MQ for MQTT does not support non-conventional characters such as slashes (/), colons (:), commas (,), and percent signs (%) in client IDs and topics. If these characters are used, connection setup may fail, and messages cannot be sent or received.
Client ID length 64 characters The client ID length cannot exceed 64 characters when MQ for MQTT is used for sending and receiving messages. Otherwise, the client may be disconnected.
Message size 64 KB The size of a message cannot exceed 64 KB. Otherwise, the message may be discarded. (This metric is customizable in the Enterprise Platinum Edition.)
Message retention period Three days Offline messages are retained for a maximum of three days only when QoS = 1 and cleanSession = false. After three days, the offline messages are automatically deleted in a scrolling manner. (This metric is customizable in the Enterprise Platinum Edition.)
Message sending/receiving TPS Depends on the instance specification. For a subscription instance, throttling is imposed based on the purchased specifications. Message delivery is not guaranteed when the limit is exceeded. For a Pay-As-You-Go instance, throttling is not imposed, but the monitoring and alarm functions are provided by default. You must adjust the monitoring threshold appropriately.
Number of client connections Depends on the instance specification. For a subscription instance, throttling is imposed based on the purchased specifications. Connection stability is not guaranteed when the limit is exceeded. For a Pay-As-You-Go instance, throttling is not imposed, but the monitoring and alarm functions are provided by default. You must adjust the monitoring threshold appropriately.
Number of subscription relationships Depends on the instance specification. For a subscription instance, throttling is imposed based on the purchased specifications. The integrity of the subscription is not guaranteed when the limit is exceeded. For a Pay-As-You-Go instance, throttling is not imposed, but the monitoring and alarm functions are provided by default. You must adjust the monitoring threshold appropriately.
Topics subscribed by a single client 30 Each MQTT client can subscribe to a maximum of 30 topics at a time when MQ for MQTT is used for sending and receiving messages. New subscriptions cannot be added when the limit is exceeded. (This metric is customizable in the Enterprise Platinum Edition.)
QoS and cleanSession Currently, cleanSession cannot be set to false when QoS is 2. Currently, the MQTT broker does not support cleanSession = false in case of QoS = 2 during message subscription if MQ for MQTT is used for sending and receiving messages. To receive offline messages, set QoS to 1 and cleanSession to false during message subscription.
Message sequence Uplink sequence Currently, only the uplink sequence is guaranteed when MQ for MQTT is used for sending and receiving messages. That is, each MQTT client sends messages in order. If messages must be consumed in order, you must use MQ TCP to receive messages.
Offline message identification delay 10 seconds When the MQTT broker pushes a message for the first time, it determines whether the message is converted to an offline message only after the message times out or fails. The corresponding delay ranges from 5 seconds to 10 seconds.
Number of stored offline messages 1,000,000 (If you require a higher limit, submit a ticket.) The MQTT broker limits the number of offline messages that are stored by each instance. If the limit is exceeded, the MQTT broker performs message cleansing from the earliest message. Set cleanSession to false appropriately during message subscription to avoid too many useless offline messages.