This topic describes the constraints and specifications for specific metrics in Message Queue for MQTT. To avoid program exceptions, you must set these metrics to values that do not exceed these limits when you use Message Queue for MQTT. The following table lists these limits.

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

Table 1. Limits on using Message Queue for MQTT
Item Limit Description
Topic length 3 to 64 characters When you use Message Queue for MQTT to send and receive a message, the topic length must be in the valid range. Otherwise, the message cannot be sent or subscribed to.
Number of topics in a single instance 25 You must pay for topics that exceed this limit. For more information, submit a ticket.
Usage of topics across regions None Relevant resources of Message Queue for MQTT and Message Queue for Apache RocketMQ must be in the same region for data interconnection. For more information, see Region-specific topics.
Characters available for topics and client IDs Digits, letters, hyphens (-), and underscores (_) Message Queue for MQTT does not support the following non-conventional characters 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 When you use Message Queue for MQTT to send and receive a message, the client ID length cannot exceed 64 characters. Otherwise, the client may be disconnected.
Number of rules for a single instance 100 If you need a higher limit, submit a ticket.
Rule deduplication Only one rule of the same type can be created for an internal resource. For example, you can create only one rule for client status notification for a group ID, and one data inbound rule and one data outbound rule for a topic in Message Queue for MQTT.
Message size 64 KB The size of a message cannot exceed 64 KB. Otherwise, this message is discarded. This metric can be customized 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 can be customized 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.
  • The messaging TPS of a pay-as-you-go instance cannot exceed 10,000. Otherwise, throttling may be imposed. If you need a larger messaging TPS, submit a ticket.
  • Generally, the number of messages sent and received by a single Message Queue for MQTT client is small, and some SDKs do not support a larger messaging TPS. We recommend that you set the messaging TPS for a single Message Queue for MQTT client to a value that is not greater than 20. If you need a larger messaging TPS on your cloud server, you can use the Message Queue for Apache RocketMQ client.
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 features 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 features are provided by default. You must adjust the monitoring threshold appropriately.
Number of topics to which a single Message Queue for MQTT client can subscribe 30 Each Message Queue for MQTT client can subscribe to a maximum of 30 topics when Message Queue for MQTT is used to send and receive messages. New subscriptions cannot be added when this limit is exceeded. This metric can be customized in the Enterprise Platinum Edition.
QoS and cleanSession The cleanSession parameter cannot be set to false when QoS is 2. When you use Message Queue for MQTT to send and receive messages:
  • If cleanSession is set to true, QoS can be 0, 1, or 2.
  • If cleanSession is set to false, QoS cannot be set to 2. Message Queue for MQTT does not support this configuration.
Token validity period 30 days When the ApplyToken operation is called with the value of ExpireTime greater than 30 days, the token is returned without any error messages. However, the token is valid for only 30 days.
Messaging in order Sending in order When you use Message Queue for MQTT to send and receive messages, only Message Queue for MQTT clients send messages in order. We recommend that you use Message Queue for Apache RocketMQ to receive messages over TCP if you need to consume messages in order.
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 5 seconds to 10 seconds.
Number of stored offline messages 1,000,000. If you need a higher limit, submit a ticket. The Message Queue for MQTT broker of an instance restricts the number of offline messages that are stored on the 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 excessive 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.
IP address corresponding to the Message Queue for MQTT domain name None
The IP address may be changed at any time. Do not assume that the IP address is fixed. The Message Queue for MQTT product team is not liable for any direct or indirect faults or losses arising in the following scenarios:
  • Your Message Queue for MQTT client uses the IP address instead of the domain name for access. The Message Queue for MQTT product team updates the domain name resolution, and the original IP address becomes invalid.
  • A firewall policy on IP addresses has been set in the network where your Message Queue for MQTT client is run. The Message Queue for MQTT product team updates the domain name resolution, and the new IP address is blocked due to the firewall policy.