This topic describes the constraints and specifications for specific metrics in Message Queue for MQTT. To prevent program exceptions, you must set these metrics to values within these limits when you use Message Queue for MQTT. The following tables describe the specific limits.

If you are using Alibaba Cloud Message Queue for MQTT Enterprise Platinum Edition, you can customize specific metrics as needed, which are marked in the following tables. For more information, .

Instance-related limits

Item Limit Description
Instance name
  • An instance name must be 3 to 64 characters in length.
  • An instance name can contain digits, letters, hyphens (-), and underscores (_). The name is not case-sensitive.
  • An instance name must be unique in the same region.
You cannot customize the name of an instance when you create the instance. The default name of a new instance is the ID of the instance. To modify the instance name, go to the Message Queue for MQTT console.
Number of transactions per second (TPS) for sending and receiving messages on a single instance
  • For a subscription instance, throttling is enabled based on the purchased specifications. Messages are not guaranteed to reach the intended Message Queue for MQTT clients when the maximum value specified in the instance specifications is exceeded.
  • For a pay-as-you-go instance, the maximum TPS for sending and receiving messages on a single instance is 10,000 by default. If the maximum value is exceeded, throttling is enabled. To increase the maximum value, .
A single Message Queue for MQTT client can send and receive only a small number of messages. In addition, specific SDKs do not support a large number of TPS for sending and receiving messages. We recommend that you set the TPS for sending and receiving messages on a single Message Queue for MQTT client to no more than 20. If you need a larger number of TPS for sending and receiving messages on your cloud server, you can use the Message Queue for Apache RocketMQ client.
Number of Message Queue for MQTT clients that are connected to a single instance
  • For a subscription instance, throttling is enabled based on the purchased specifications. Messages are not guaranteed to reach the intended Message Queue for MQTT clients when the maximum value specified in the instance specifications is exceeded.
  • For a pay-as-you-go instance, the number of Message Queue for MQTT clients that are connected to it is unlimited.
By default, Message Queue for MQTT sends alerts if the maximum number of Message Queue for MQTT clients that are connected to a single instance is exceeded. Adjust the maximum value to an appropriate value.
Number of subscriptions on a single instance
  • For a subscription instance, throttling is enabled based on the purchased specifications. The integrity of subscriptions is not guaranteed when the maximum value specified in the instance specifications is exceeded.
  • For a pay-as-you-go instance, the number of subscriptions is unlimited.
By default, Message Queue for MQTT sends alerts if the number of subscriptions on a single instance is exceeded. Adjust the maximum value to an appropriate value.
IP addresses of the domain name that is used as the endpoint of an instance N/A The IP address may be changed at any time. Do not assume that the IP address is fixed. The service team of Message Queue for MQTT is not liable for the 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 service 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 service team of Message Queue for MQTT updates domain name resolution.

Topic-related limits

Item Limit Description
Topic name
  • A topic name must be 3 to 64 characters in length.
    Note The length of a topic name refers to the total length of the name for a parent topic and its subtopics.
  • A topic name can contain digits, letters, hyphens (-), and underscores (_). The name is not case-sensitive.
  • The name of a parent topic on the same instance must be unique.
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 parent topics on a single instance Maximum value: 25 If the default maximum value cannot meet your requirements, to increase the maximum value.
Usage of topics across regions Not supported 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.

Client-related limits

Item Limit Description
Client ID
  • A client ID must be 0 to 64 characters in length.
  • A client ID can contain digits, letters, hyphens (-), and underscores (_).
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 topics to which a single Message Queue for MQTT client can subscribe Maximum value: 30 Each Message Queue for MQTT client can subscribe to a maximum of 30 topics at the same time. If the number of subscribed topics reaches 30, new subscriptions cannot be added. If you are using Alibaba Cloud Message Queue for MQTT Enterprise Platinum Edition, you can to increase the maximum value.

If topics are subscribed to by using a subscription that contains wildcards, the topics are counted as a subscribed topic. If different subtopics of the same parent topic are subscribed to, each subtopic is counted as a subscribed topic. For example, A/# is counted as a subscribed topic. A/# and A/a1/# are counted as two subscribed topics.

Group ID
  • A group ID must be 7 to 64 characters in length.
  • A group ID can contain digits, letters, hyphens (-), and underscores (_). It must start with GID_ or GID-.
  • A group ID must be unique on the same instance.
When you use Message Queue for MQTT to send and receive messages, the length of a group ID must be within the valid range. Otherwise, the messages cannot be sent or subscribed to.
Number of subscriptions that contain wildcards Each parent topic allows up to 100 subscriptions that contain wildcards. The Message Queue for MQTT broker supports a limited number of active subscriptions that contain wildcards under each parent topic. When the maximum value 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 subscriptions that contain wildcards. For example, the subscriptions to A/#, A/a1, and A/a2/# under the same Parent Topic A are counted as three subscriptions.

Rule-related limits

Item Limit Description
Number of rules for a single instance Maximum value: 100 If the default maximum value cannot meet your requirements, to increase the maximum value.
Rule deduplication Only one rule of the same type can be created for each 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.

Limits related to sending and receiving messages

Item Limit Description
Message size Maximum size: 64 KB If the size of a message exceeds the maximum value, the message is discarded.

If you are using Alibaba Cloud Message Queue for MQTT Enterprise Platinum Edition, you can to increase the maximum value.

Message retention period Maximum period: three days Message Queue for MQTT retains offline messages only when the QoS parameter is set to 1 and the cleanSession parameter is set to false. The offline messages can be retained for up to three days and are automatically deleted after this period. For more information about the QoS and cleanSession parameters, see Terms.

If you are using Alibaba Cloud Message Queue for MQTT Enterprise Platinum Edition, you can to increase the message retention period.

QoS and cleanSession configurations You cannot set the QoS parameter to 2 and the cleanSession parameter to false at the same time. When you use Message Queue for MQTT to send and receive messages:
  • If the cleanSession parameter is set to true, the QoS parameter can be set to 0, 1, or 2.
  • If the cleanSession parameter is set to false, the QoS parameter cannot be set to 2. Message Queue for MQTT does not support this configuration.
Token validity period 30 days When you call the ApplyToken operation, if the ExpireTime parameter is set to a value greater than 30, a token is returned and no error is reported. However, the token is valid only for 30 days.
Period of waiting for a message timeout or failure Maximum period: 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 waiting period ranges from 5 seconds to 10 seconds.
Number of stored offline messages Maximum value: 1,000,000 The Message Queue for MQTT broker of an instance limits the number of offline messages stored on the instance. If the maximum value is exceeded, the Message Queue for MQTT broker deletes messages from the earliest stored ones. Therefore, to prevent an excessive number of offline messages, set the cleanSession parameter to an appropriate value when you subscribe to topics.

If the default maximum value cannot meet your requirements, to increase the maximum value.

Limits related to cloud API operations

For more information about the maximum number of queries per second (QPS) for the cloud API, see QPS limits.