ApsaraMQ for MQTT (formerly MQ for MQTT) is a lightweight message-oriented middleware for mobile Internet and Internet of Things (IoT) applications. Traditional message-oriented middleware transmits messages between microservices. ApsaraMQ for MQTT instead transmits messages between devices and the cloud, enabling bidirectional communication at scale.
ApsaraMQ for MQTT was previously known as MQ for MQTT. The product has been renamed; the service is actively maintained and all features remain available. If you are looking for documentation on MQ for MQTT, you are in the right place.
If ApsaraMQ for MQTT does not meet your business requirements, consider evaluating other Alibaba Cloud messaging products, such as ApsaraMQ for RocketMQ or ApsaraMQ for RabbitMQ.
Examples:
A fleet of temperature sensors reports readings every 5 seconds to a cloud analytics dashboard.
A backend service pushes firmware update commands to thousands of smart devices simultaneously.
Two mobile apps exchange instant messages through the MQTT protocol without routing through a backend server.
Terms
| Term | Definition |
|---|---|
| Topic | The primary classifier for messages. Producers send messages to topics, and consumers subscribe to topics to receive messages. |
| Producer | The publisher that creates and sends messages to a topic. |
| Consumer | The subscriber that receives and processes messages from a topic. |
| Message | The data payload sent by a producer to a topic and delivered to one or more consumers. |
| Rule | A resource that exchanges data between ApsaraMQ for MQTT and other Alibaba Cloud services. |
FAQ: ApsaraMQ for MQTT and EMQX
What is the difference between ApsaraMQ for MQTT and EMQX? Does ApsaraMQ for MQTT support EMQX Dashboard?
ApsaraMQ for MQTT is not based on EMQX. EMQX is an open-source MQTT broker that you must deploy and maintain on your own infrastructure, such as Elastic Compute Service (ECS) instances. ApsaraMQ for MQTT, by contrast, is a fully managed cloud service provided by Alibaba Cloud. You activate it through the ApsaraMQ for MQTT console and connect to your instance using a dedicated endpoint. There is no infrastructure to manage.
ApsaraMQ for MQTT does not support EMQX Dashboard or similar third-party management interfaces. For monitoring and management operations, use the ApsaraMQ for MQTT console.
Messaging models
ApsaraMQ for MQTT supports two messaging models.
Device-to-cloud communication
Devices connect to ApsaraMQ for MQTT and exchange data with cloud applications or other Alibaba Cloud services. This model covers scenarios such as:
A smart thermostat reports temperature, humidity, and battery level to a cloud monitoring dashboard every 10 seconds.
A backend service sends configuration updates or reboot commands to devices in the field.

Device-to-device communication
Devices communicate directly with each other through ApsaraMQ for MQTT. Both producers and consumers connect over the MQTT protocol. This model covers scenarios such as:
Users chat through an instant messaging app with sub-second message delivery.
A mobile app controls a smart home device -- adjusting lights or locking doors -- without routing through a backend server.

Developer roles
These models map to two developer roles:
| Role | Scope | SDK reference |
|---|---|---|
| Device developer | Build client-side applications that run on IoT devices or mobile endpoints. | Download the SDK |
| Cloud developer | Build server-side applications that process device data or send commands. | Obtain SDKs for the control API |
Benefits
Broad protocol and platform support
ApsaraMQ for MQTT is compatible with SDKs that support MQTT V3.1.1 and supports WebSocket connections. This spans most mobile development platforms and programming languages, enabling seamless migration from existing MQTT implementations.
When you create an instance, both a public endpoint and an internal network endpoint are automatically generated. The public endpoint supports connections over the public internet — including corporate Wi-Fi and office networks — making it convenient for mobile devices and IoT devices to connect from outside an Alibaba Cloud VPC.
Service-side upgrades to ApsaraMQ for MQTT are architectural improvements and do not change the MQTT protocol version. The service continues to support MQTT 3.1.1, and your client applications do not need to update their protocol version configuration after a service-side upgrade.
Although ApsaraMQ for MQTT is compatible with the standard MQTT protocol, some third-party open-source client libraries may cause connection drops due to parameter configuration differences. Known compatibility issues include paho-mqtt v2 and Node.js mqtt.js when connecting to Serverless instances.
Use the officially recommended SDKs. If you use a third-party library, adjust key connection parameters such as Keep Alive and Clean Session according to the connection parameter guidance in the terminal developer guide to ensure connection stability.
Millisecond-level messaging at massive scale
| Metric | Capability |
|---|---|
| Latency | Messages delivered within milliseconds |
| Connected devices | Tens of millions of concurrent device connections |
| Concurrent messages | Millions of concurrent messages |
| Throughput | Trillions of message transactions |
| Architecture | Distributed design with no single-point bottlenecks; unlimited horizontal scale-out for each component |
Device-level security
| Capability | Description |
|---|---|
| Device-level permission management | Manage permissions at the individual device level |
| Temporary tokens | Issue short-lived credentials for device authentication |
| Encrypted transport | Secure all data in transit with Transport Layer Security (TLS) V1.2 |
Integration with ApsaraMQ for RocketMQ
Exchange messages between ApsaraMQ for MQTT and ApsaraMQ for RocketMQ for reliable, high-throughput two-way communication between devices and cloud applications. This integration bridges lightweight device messaging with enterprise-grade message queuing.
Scenarios
ApsaraMQ for MQTT serves a wide range of mobile Internet and IoT use cases:
| Scenario | Example |
|---|---|
| Mobile live-streaming | Deliver real-time interactive messages -- comments, likes, and gifts -- alongside video streams to millions of concurrent viewers. |
| Internet of Vehicles (IoV) | Collect telemetry from connected vehicles (speed, fuel level, location) and push over-the-air updates or navigation commands. |
| Payment | Transmit transaction notifications and status updates between payment terminals and processing backends in real time. |
| Smart catering | Connect kitchen display systems, ordering tablets, and management platforms for real-time order synchronization across locations. |
| Instant messaging | Deliver chat messages between mobile or web clients with sub-second latency. |

FAQ: Deployment
Does ApsaraMQ for MQTT support private deployment?
No. ApsaraMQ for MQTT is a fully managed public cloud service and does not support private (on-premises) deployment.
If you need to integrate ApsaraMQ for MQTT with other products such as InfluxDB, implement the integration in the public cloud environment through VPC internal network connectivity or cross-product data routing rules.
Get started
Purchase an ApsaraMQ for MQTT instance on the ApsaraMQ for MQTT buy page.
FAQ: Troubleshooting
My instance status is normal, but the domain name cannot be resolved. What should I do?
The domain name resolution of ApsaraMQ for MQTT endpoints depends on whether the underlying ApsaraMQ for RocketMQ service has been activated. Even if your MQTT instance status shows Running or Active — for example, after recovering from an overdue payment — the endpoint domain name cannot be resolved if the underlying ApsaraMQ for RocketMQ service was not separately activated.
To resolve this issue:
Log on to the ApsaraMQ for MQTT console.
Check whether ApsaraMQ for RocketMQ is activated and manually complete the activation if needed.
Wait for domain name resolution to recover before you attempt to connect.