Data inbound rules enable ApsaraMQ for MQTT to receive messages from other Alibaba Cloud services and push them to MQTT clients over the Message Queuing Telemetry Transport (MQTT) protocol. You can call the API operations of Alibaba Cloud services to send data to ApsaraMQ for MQTT clients.
How it works
A data inbound rule connects an Alibaba Cloud service to ApsaraMQ for MQTT. The data flows through three stages:
A backend service sends a message to ApsaraMQ for RocketMQ through an API operation.
ApsaraMQ for MQTT retrieves the message based on the configured data inbound rule and maps the RocketMQ topic to an MQTT parent topic.
The ApsaraMQ for MQTT broker pushes the message to subscribed MQTT clients.

Use cases
Cloud-to-device message delivery
A backend service deployed on the cloud sends a message to ApsaraMQ for RocketMQ. The data inbound rule maps the RocketMQ topic to an ApsaraMQ for MQTT topic, and the broker pushes the message to the target MQTT clients.
Limitations
| Item | Limit | Description |
|---|---|---|
| Rules per instance | 100 | To increase this limit, contact ApsaraMQ for MQTT technical support. |
| Rule deduplication | One rule of each type per internal resource | Each group ID supports one client status notification rule. Each topic supports one data inbound rule and one data outbound rule. |
| Cross-region rules | Not supported | The source and destination instances must reside in the same region. For example, if the ApsaraMQ for MQTT instance is in the China (Hangzhou) region, the ApsaraMQ for RocketMQ instance must also be in China (Hangzhou). |
| ApsaraMQ for RocketMQ version | 4.0 only | ApsaraMQ for RocketMQ 5.0 instances do not support data inbound or data outbound rules. |
Usage notes
MQTT clients may experience message delivery latency while the ApsaraMQ for RocketMQ broker is undergoing a service update. For update schedules, see Notice List.
Resource mappings
Data inbound rules map resources at the parent topic level. A single rule imports data from a specific ApsaraMQ for RocketMQ resource into an ApsaraMQ for MQTT parent topic. Subtopics on ApsaraMQ for MQTT are mapped to message properties in ApsaraMQ for RocketMQ.
| ApsaraMQ for MQTT resource | Alibaba Cloud service | Service resource | Packet definition |
|---|---|---|---|
| Topics | ApsaraMQ for RocketMQ | Topics | Message structure mappings between ApsaraMQ for MQTT and ApsaraMQ for RocketMQ |
What's next
Manage data inbound rules -- Step-by-step instructions for creating and managing data inbound rules in the console.
Message structure mappings between ApsaraMQ for MQTT and ApsaraMQ for RocketMQ -- Details on how message fields map between the two services.