You can configure data inbound rules of Message Queue for MQTT to customize the redirection of inbound data from other Alibaba Cloud services to Message Queue for MQTT. This topic describes the principles and scenarios of redirecting cross-service inbound data. It also describes the resource mappings between Message Queue for MQTT and other Alibaba Cloud services.

Principles

You must create a data inbound rule before you can import data from other Alibaba Cloud services to Message Queue for MQTT. This rule serves to read data from the Alibaba Cloud service that you have configured and push the data to an MQTT client by using the MQTT protocol. In this way, you can directly call an API of the Alibaba Cloud service to send data to the MQTT client.

Notice You can import data only from Message Queue for Apache RocketMQ to Message Queue for MQTT.

Scenarios

Command sending

The background management service deployed in the cloud sends a command to Message Queue for Apache RocketMQ. Based on the data inbound rule in place,Message Queue for MQTT maps the topics of Message Queue for Apache RocketMQ to MQTT topics and pushes the corresponding data to target MQTT devices.

Resource mapping methods

Data inbound rules support mapping resources to a specific parent topic of Message Queue for MQTT, so that you can import the data of a resource in other Alibaba Cloud services to a parent topic of Message Queue for MQTT. You can configure subtopics for MQTT-based pushes by using other extension properties.

Table 1. Mappings
Message Queue for MQTT resource Other Alibaba Cloud services Resources of other Alibaba Cloud services Packet definition
MQTT Topic Message Queue for Apache RocketMQ Message Queue for Apache RocketMQ topic Message structure mappings between MQTT and RocketMQ

References