This topic describes the limits that Message Queue for MQTT imposes on certain metrics. When you use Message Queue for MQTT, make sure that these limits are not exceeded to avoid exceptions. The following table lists these limits:

If you are using Message Queue 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 Message Queue for MQTT
Item Threshold Description
Topic length 64 characters The length of a topic cannot exceed 64 characters when you use Message Queue for MQTT to send and receive messages. Otherwise, messages cannot be published to this topic or this topic cannot be subscribed to.
Number of topics 25 Additional topics will be charged. More details about the fees, please submit a ticket to query.
Usage of topics across regions The topic of a Message Queue for MQTT instance must be in the same region as the topic of a backend message persistence instance (such as a Message Queue for Apache RocketMQ instance) bound to this Message Queue for MQTT instance. For more information, see Region-specific topics.
Characters available for topics and client IDs Digits 0-9, letters a-z or A-Z, hyphen (-), and underscore (_) Message Queue 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 length of a client ID cannot exceed 64 characters when Message Queue for MQTT is used to send and receive messages. Otherwise, the Message Queue for MQTT client may be disconnected from the Message Queue for MQTT broker.
Number of rules per instance 100 If the limit cannot meet your demand, please submit a ticket.
Rule duplication limit Only one rule of one kind can be created within a resource. A group ID can be associated with one notify rule. An MQTT topic can be associated with one data inflow rule and one data outflow rule.
Message size 64 KB The size of a message cannot exceed 64 KB. Otherwise, this message is 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 the quality of service (QoS) is set to 1 and cleanSession is set to false. After three days, the offline messages are automatically deleted in a rolling manner. (This metric is customizable in the Enterprise Platinum Edition.)
Messaging transactions per second (TPS) Depends on instance specifications. For a subscription instance, throttling is imposed based on the purchased specifications. Message delivery is not guaranteed when the limit specified in the instance specifications is exceeded. For a pay-as-you-go instance, throttling is not imposed, but the monitoring and alerting functions are provided by default. You must adjust the monitoring threshold appropriately.
Number of connected clients Depends on instance specifications. For a subscription instance, throttling is imposed based on the purchased specifications. Connection stability is not guaranteed when the limit specified in the instance specifications is exceeded. For a pay-as-you-go instance, throttling is not imposed, but the monitoring and alerting functions are provided by default. You must adjust the monitoring threshold appropriately.
Number of subscriptions Depends on instance specifications. For a subscription instance, throttling is imposed based on the purchased specifications. The integrity of subscriptions is not guaranteed when the limit specified in the instance specifications is exceeded. For a pay-as-you-go instance, throttling is not imposed, but the monitoring and alerting functions are provided by default. You must adjust the monitoring threshold appropriately.
Topics to which a Message Queue for MQTT client can subscribe 30 topics Each Message Queue for MQTT client can subscribe to a maximum of 30 topics at a time when Message Queue for MQTT is used to send and receive messages. New subscriptions cannot be added when this 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 Message Queue for MQTT broker does not support subscriptions when QoS is set to 2 and cleanSession is set to false. To receive offline messages, set QoS to 1 and cleanSession to false. That is, use QoS 1 and a persistent session.
Token validity period 30 days When the token API is called with the value of ExpireTime greater than 30 days, the token is returned without any error messages. However, the token is actually valid for 30 days.
Message sequence Publishing sequence Currently, only the publishing sequence is guaranteed when Message Queue for MQTT is used to send and receive messages. That is, each Message Queue for MQTT client publishes messages in order. If messages need to be consumed in order, you must receive messages over TCP.
Time consumed on waiting for message timeout or failure 10 seconds When the Message Queue for MQTT broker pushes a message for the first time, it determines whether this message is converted to an offline message only after this message times out or fails. The corresponding delay ranges from five seconds to 10 seconds.
Number of stored offline messages 1,000,000 (If you require a higher limit, submit a ticket.) The Message Queue for MQTT broker restricts the number of offline messages that are stored on each instance. If this limit is exceeded, the Message Queue for MQTT broker cleans up messages from the earliest message. Therefore, use the cleanSession parameter appropriately during subscription to avoid too many useless offline messages.
Wildcard subscriptions Each parent topic allows only 100 wildcard subscriptions. The Message Queue for MQTT broker restricts the maximum number of active wildcard subscriptions for each parent topic. When the limit is exceeded, the Message Queue for MQTT broker loads only 100 subscriptions and some subscribers may fail to receive messages. Therefore, you must control the number of wildcard subscriptions.