This topic describes the limits for metrics in ApsaraMQ for MQTT. To prevent program exceptions, you must set the metrics to values within limits when you use ApsaraMQ for MQTT. The table in the following section describes the limits.

If you use a ApsaraMQ for MQTT Enterprise Platinum Edition instance, you can specify custom values for specific metrics in the following table based on your business requirements. To specify custom values for the metrics, contact ApsaraMQ for MQTT technical support.

Table 1. Limits on using Message Queue for MQTT
MetricLimitDescription
Topic name length64 charactersWhen you use ApsaraMQ for MQTT to send and receive messages, the length of a topic name cannot exceed 64 characters. Otherwise, you cannot send or receive messages.
Use of topics across regionsNoneThe topic of a ApsaraMQ for MQTT instance must reside in the same region as the topic of a backend message persistence instance, such as a ApsaraMQ for RocketMQ instance, to which the Message Queue for MQTT instance is bound.
Characters allowed in a topic name and a client IDDigits, letters, hyphens (-), and underscores (_)A topic name or a client ID in ApsaraMQ for MQTT cannot contain non-conventional characters such as slashes (/), colons (:), commas (,), and percent signs (%). If the topic name or client ID contains non-conventional characters, client connection may fail and messages may not be sent or received.
Length of a client ID64 charactersWhen you use ApsaraMQ for MQTT to send and receive messages, the client ID cannot exceed 64 characters in length. Otherwise, the client may be disconnected.
Message size64 KBA message cannot exceed 64 KB in size. Otherwise, the message is discarded. You can specify a custom value for this metric in an Enterprise Platinum Edition instance.
Message retention periodThree daysOffline messages can be retained for up to three days only when the QoS parameter is set to 1 and the cleanSession parameter is set to false. After three days, the offline messages are automatically deleted. You can specify a custom value for this metric in an Enterprise Platinum Edition instance.
Messaging transactions per second (TPS)The limit varies based on the instance specification.
  • For a subscription instance, throttling is imposed based on the purchased specification. Message delivery to the intended Message Queue for MQTT client cannot be ensured if the upper limit that is specified in the instance specification is exceeded.
  • The messaging TPS of a pay-as-you-go instance cannot exceed 50,000. Otherwise, throttling may be triggered. If you want to increase the messaging TPS, contact ApsaraMQ for MQTT technical support.
  • A Message Queue for MQTT client can send and receive only a small number of messages. Specific SDKs do not support a large number of messaging TPS. We recommend that you set the messaging TPS on a Message Queue for MQTT client to no more than 20. If you want to increase the messaging TPS on your broker, you can use the ApsaraMQ for RocketMQ client.
Number of connected clientsThe limit varies based on the instance specification.For a subscription instance, throttling is imposed based on the purchased specification. Connection stability cannot be ensured if the upper limit that is specified in the instance specification is exceeded. For a pay-as-you-go instance, throttling is not imposed. By default, the monitoring and alerting feature is enabled. We recommend that you specify monitoring and alerting thresholds based on your business requirements.
Number of subscriptionsThe limit varies based on the instance specification.For a subscription instance, throttling is imposed based on the purchased specification. The integrity of subscriptions cannot be ensured if the upper limit that is specified in the instance specification is exceeded. For a pay-as-you-go instance, throttling is not imposed. By default, the monitoring and alerting feature is enabled. We recommend that you specify monitoring and alerting thresholds based on your business requirements.
Number of topics to which a single Message Queue for MQTT client can subscribe30Each Message Queue for MQTT client can subscribe to up to 30 topics when ApsaraMQ for MQTT is used to send and receive messages. New subscriptions cannot be added if the limit is exceeded. You can specify a custom value for this metric in an Enterprise Platinum Edition instance.
QoS and cleanSession configurationsThe cleanSession parameter cannot be set to false when the QoS parameter is set to 2.A ApsaraMQ for MQTT broker does not support subscriptions when the QoS parameter is set to 2 and the cleanSession parameter is set to false. To receive offline messages, set the QoS parameter to 1 and the cleanSession parameter to false.
Validity period of a token30 DaysThe validity period of a token is 30 days. When you call the ApplyToken operation to apply for a token and the ExpireTime parameter is set to a value greater than 30, a token is returned and no error is reported, but the token is valid for only 30 days.
Order of messagesMessages are sent in the same order as they are produced.When you use ApsaraMQ for MQTT to send and receive messages, only the order for sending messages is ensured. If you want to consume messages in order, you must use ApsaraMQ for RocketMQ to receive messages over TCP.
Waiting period for offline messages10 secondsThe first time a Message Queue for MQTT broker pushes a message, the broker can determine whether the message is converted to an offline message only after the message times out or fails. The waiting period ranges from 5 seconds to 10 seconds.
Number of stored offline messages1,000,000The Message Queue for MQTT broker of an instance limits the number of offline messages that are stored on the broker. If the upper limit is exceeded, the Message Queue for MQTT broker deletes the earliest stored offline messages. To avoid an excessive number of offline messages, configure the cleanSession parameter based on your business requirements when you subscribe to topics.

If the default maximum value does not meet your business requirements, contact ApsaraMQ for MQTT technical support.

Number of subscriptions that contain wildcardsEach parent topic supports up to 100 subscriptions that contain wildcards. The Message Queue for MQTT broker supports a limited number of active subscriptions that contain wildcards for 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. We recommend that you strictly control the number of subscriptions that contain wildcards.
IP address of the endpoint for the domain name of ApsaraMQ for MQTTNone
The IP address may unexpectedly change. Do not assume that the IP address is fixed. The ApsaraMQ for MQTT technical team is not liable for faults and direct or indirect losses in the following scenarios:
  • Your Message Queue for MQTT client uses an IP address instead of a domain name to access the Message Queue for MQTT broker. The original IP address becomes invalid after the Message Queue for MQTT technical team updates the domain name resolution.
  • A firewall policy on IP addresses is configured in the network in which your Message Queue for MQTT client is running. New IP addresses are blocked due to the firewall policy after the Message Queue for MQTT technical team updates the domain name resolution.