All Products
Search
Document Center

ApsaraMQ for MQTT:Import data from other cloud services to ApsaraMQ for MQTT

Last Updated:Sep 22, 2023

You can configure data inbound rules for ApsaraMQ for MQTT to import data from other Alibaba Cloud services to ApsaraMQ for MQTT. This topic describes the working mechanism, scenarios, and limits of importing data from other Alibaba Cloud services to ApsaraMQ for MQTT. This topic also describes the resource mappings between ApsaraMQ for MQTT and other Alibaba Cloud services.

Working mechanism

To import data from other Alibaba Cloud services to ApsaraMQ for MQTT, you must create data inbound rules. ApsaraMQ for MQTT uses data inbound rules to obtain data from other Alibaba Cloud services. Then, the ApsaraMQ for MQTT broker pushes the data to ApsaraMQ for MQTT clients by using the Message Queuing Telemetry Transport (MQTT) protocol. This way, you can call the API operations of Alibaba Cloud services to send data to ApsaraMQ for MQTT clients.数据流入

Scenarios

Message sending

A backend service application that is deployed on the cloud sends a message to ApsaraMQ for RocketMQ. Based on the configured data inbound rule, ApsaraMQ for MQTT maps data in the topics of ApsaraMQ for RocketMQ to the topics of ApsaraMQ for MQTT, and pushes the data to the destination ApsaraMQ for MQTT clients.

Usage notes

When ApsaraMQ for MQTT uses a data inflow rule to receive messages from ApsaraMQ for RocketMQ, the ApsaraMQ for MQTT client may receive messages with latency if the ApsaraMQ for RocketMQ broker is being updated. For information about service updates, see Notice List.

Limits

ItemLimitDescription
Number of rules for a single instance100If the default maximum value does not meet your business requirements, contact ApsaraMQ for MQTT technical support.
Rule deduplicationOnly one rule of the same type can be created for each internal resource. For example, you can create only one rule for client status notification for each group ID, and one data inbound rule and one data outbound rule for each topic in Message Queue for MQTT.
Supported regionsYou cannot create rules across regions. The instances to which the data source and data destination of a rule belong must reside in the same region. For example, when you create a data outflow rule, if the source ApsaraMQ for MQTT instance resides in the China (Hangzhou) region, you can select only a ApsaraMQ for RocketMQ instance that resides in the China (Hangzhou) region as the destination instance.
ApsaraMQ for RocketMQ instance versionOnly ApsaraMQ for RocketMQ 4.0 instances are supported.

When ApsaraMQ for MQTT and ApsaraMQ for RocketMQ exchange data based on message inflow and outflow rules, you can only use ApsaraMQ for RocketMQ 4.0 instances. ApsaraMQ for RocketMQ 5.0 instances do not support message inflow and outflow rules.

Resource mapping methods

Data inbound rules allow you to map data based on the parent topics of ApsaraMQ for MQTT. You can import data in a specific resource of another Alibaba Cloud service to a parent topic on ApsaraMQ for MQTT. Data in subtopics on ApsaraMQ for MQTT are mapped to the message properties in ApsaraMQ for Apache RocketMQ.

Table 1. Mappings

ApsaraMQ for MQTT resource

Alibaba Cloud service

Resource of the Alibaba Cloud service

Packet definition

Topics on ApsaraMQ for MQTT

ApsaraMQ for RocketMQ

Topics on ApsaraMQ for RocketMQ

Message structure mappings between ApsaraMQ for MQTT and ApsaraMQ for Apache RocketMQ

References

For information about operations in the ApsaraMQ for RocketMQ console, see Manage data inbound rules.