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

Principles

You must create a data outbound rule before you can export data from Message Queue for MQTT to other Alibaba Cloud services. This rule serves to export the messages sent by an MQTT client to another Alibaba Cloud service that you have configured. In this way, you can directly call an API of the cloud service to read the messages sent by the MQTT client.
Notice You can export data only from Message Queue for MQTT to Message Queue for Apache RocketMQ.

Scenarios

Device data reporting

Massive devices report their status data to Message Queue for MQTT by using the MQTT protocol. After you configure a data outbound rule to map the topics of Message Queue for MQTT to the topics of Message Queue for Apache RocketMQ, you can start the consumer data processing service of Message Queue for Apache RocketMQ in the admin site to process the reported data.

Rule-based mapping

Data outbound rules support mapping resources to a specific parent topic of Message Queue for MQTT, so you can export all messages under a parent topic of Message Queue for MQTT to a resource in other Alibaba Cloud services. You can configure MQTT-based subtopics 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