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 within these limits when you use Message Queue for MQTT. The following table lists the specific limits.

If you are using Message Queue for MQTT Enterprise Platinum Edition, 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
Length of a topic name 3 to 64 characters When you use Message Queue for MQTT to send and receive messages, the length of a topic name must be within the valid range. Otherwise, the messages 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 A data exchange rule is configured, and relevant resources of Message Queue for MQTT and Message Queue for Apache RocketMQ must be in the same region for data exchange. For more information, see Region-specific topics.
Characters allowed in topic names and client IDs Digits, letters, hyphens (-), and underscores (_) Message Queue for MQTT does not allow the following non-conventional characters in client IDs and topic names. If these characters are used, you may fail to establish connections or send or receive messages in the service.
  • /
    Note A forward slash (/) is used to separate a parent topic and its subtopics.
  • :
  • ,
  • %
Length of a client ID 64 characters When you use Message Queue for MQTT to send and receive messages, the client ID cannot exceed 64 characters in length. 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 one internal resource. For example, you can create only one rule for client status notification for each group ID, and one data inbound rule and one data outbound rule for each topic in Message Queue for MQTT.
Message size 64 KB A message cannot exceed 64 KB in size. Otherwise, this message is discarded. This metric can be customized in the Enterprise Platinum Edition.
Message retention period 3 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. Three days later, the offline messages are automatically deleted. This metric can be customized in the Enterprise Platinum Edition.
Messaging transactions per second (TPS) The value varies with instance specifications.
  • For a subscription instance, throttling is imposed based on the purchased specifications. Messages are not guaranteed to reach the intended Message Queue for MQTT clients 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 triggered. If you need a larger number of messaging TPS, submit a ticket.
  • A single Message Queue for MQTT client can send and receive only a small number of messages. Some SDKs do not support a large number of messaging TPS. We recommend that you set the messaging TPS for a single Message Queue for MQTT client to 20 or less than 20. If you need a larger number of messaging TPS on your cloud server, you can use the Message Queue for Apache RocketMQ client.
Number of connected clients The value varies with 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 feature is provided by default. You must properly adjust the alert thresholds.
Number of subscriptions The value varies with 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 feature is provided by default. You must properly adjust the alert thresholds.
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 you use Message Queue for MQTT to send and receive messages. New subscriptions may fail to be added if this limit is exceeded. This metric can be customized in the Enterprise Platinum Edition. When you calculate the number of topics to which a Message Queue for MQTT client subscribes, a subscription that contains wildcards is calculated as one topic subscription. Different subtopics of the same parent topic is calculated as different topics. For example, A/# is calculated as one topic subscription. A/# and A/a1/# are calculated as two topic subscriptions.
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 set to 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, if ExpireTime is set to a value greater than 30 days, a token is returned and no error is reported. However, the token is valid for only 30 days.
Messaging in order Messages are sent in order. When you use Message Queue for MQTT to send and receive messages, only Message Queue for MQTT clients send messages in order. To consume messages in order, we recommend that you use Message Queue for Apache RocketMQ to receive messages over TCP.
Time consumed on waiting for message timeout or failure 10 seconds After the Message Queue for MQTT broker pushes a message for the first time, the broker cannot determine whether this message is converted to an offline message before this message times out or fails. The 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 stored on the instance. If this limit is exceeded, the Message Queue for MQTT broker deletes messages from the earliest stored ones. Therefore, to avoid an excessive number of offline messages, set the cleanSession parameter to an appropriate value when you subscribe to topics.
Wildcard subscriptions Each parent topic allows up to 100 wildcard subscriptions. The Message Queue for MQTT broker supports a limited number of active wildcard subscriptions under each parent topic. When the limit is exceeded, the Message Queue for MQTT broker loads only 100 subscriptions. As a result, some subscribers may fail to receive messages. Therefore, you must control the number of wildcard subscriptions. For example, for parent topic A, subscribed A/#, A/a1/#, and A/a2/# are calculated as three subscriptions.
IP address of the endpoint for the domain name of Message Queue for MQTT None The IP address may be changed at any time. Do not assume that the IP address is fixed. The product team of Message Queue for MQTT is not liable for direct or indirect faults or losses that arise in the following scenarios:
  • Your Message Queue for MQTT client uses an IP address instead of a domain name to access the service. The original IP address becomes invalid after the product team of Message Queue for MQTT updates domain name resolution.
  • A firewall policy on IP addresses is set in the network where your Message Queue for MQTT client is running. New IP addresses are blocked due to the firewall policy after the product team of Message Queue for MQTT updates domain name resolution.