All Products
Search
Document Center

ApsaraMQ for MQTT:Manage data outbound rules

Last Updated:Mar 11, 2026

Data outbound rules forward messages published to ApsaraMQ for MQTT topics to other Alibaba Cloud services. After a rule is active, messages are automatically delivered to the destination service and can be consumed through its API. Currently, only ApsaraMQ for RocketMQ 4.0 is supported as a destination.

Data outbound flow

How it works

When you create a data outbound rule, you specify a source MQTT topic and a destination RocketMQ topic. ApsaraMQ for MQTT continuously forwards all messages published to the source topic to the destination topic. You can then consume these messages through the ApsaraMQ for RocketMQ API.

ApsaraMQ for MQTT supports multi-level topics, but ApsaraMQ for RocketMQ supports only single-level topics. During forwarding, a level-1 MQTT topic maps to a RocketMQ topic, while sub-level MQTT topics map to RocketMQ message properties. For details, see Message structure mappings between ApsaraMQ for MQTT and ApsaraMQ for RocketMQ.

Create a data outbound rule

Before you begin, ensure that you have:

  • An ApsaraMQ for MQTT instance with kernel version V3.x.x

  • An ApsaraMQ for RocketMQ 4.0 instance in the same region as the MQTT instance

  • Topics created on both instances

View the kernel version of your MQTT instance in the instance list or on the Instance Details page in the ApsaraMQ for MQTT console.

To create a data outbound rule:

  1. Log on to the ApsaraMQ for MQTT console. In the left-side navigation pane, click Instances.

  2. In the top navigation bar, select the region where the instance resides. On the Instances page, click the instance name to go to the Instance Details page.

  3. In the left-side navigation pane, click Rules. In the upper-left corner of the Rules page, click Create Rule.

  4. In the Configure Basic Information step, set the following parameters and click Next.

    ParameterRequiredExampleDescription
    Rule IDYes111111Globally unique identifier. Allowed characters: letters, digits, hyphens (-), and underscores (_). Must include at least one letter or digit. Length: 3 to 64 characters (auto-truncated if longer). Cannot be changed after creation.
    DescriptionNomigrate from rocketmqDescription of the rule.
    StatusYesEnableWhether to enable the rule upon creation. Valid values: Enable, Disable.
    Rule TypeYesData OutboundThe type of the rule. Valid values: Data Outbound: Forward MQTT messages to another Alibaba Cloud service. For more information, see Export data from ApsaraMQ for MQTT to other Alibaba Cloud services. Data Inbound: Import data from other Alibaba Cloud services to ApsaraMQ for MQTT. For more information, see Import data from other cloud services to ApsaraMQ for MQTT. Client Status Notification: Export the status events of ApsaraMQ for MQTT clients to other Alibaba Cloud services. For more information, see Export status events of ApsaraMQ for MQTT clients.
  5. In the Configure Rule Source step, specify the source topic and click Next.

    Important

    ApsaraMQ for MQTT supports multi-level topics, but ApsaraMQ for RocketMQ supports only single-level topics. A level-1 MQTT topic maps to a RocketMQ topic, while sub-level MQTT topics map to RocketMQ message properties. For details, see Message structure mappings between ApsaraMQ for MQTT and ApsaraMQ for RocketMQ.

    ParameterRequiredExampleDescription
    TopicYesTopic AThe MQTT topic from which to export data.
  6. In the Configure Rule Destination step, specify the destination and click Create.

    ParameterRequiredExampleDescription
    Destination Service TypeYesMessage Queue for Apache RocketMQOnly ApsaraMQ for RocketMQ is supported.
    Message Queue for Apache RocketMQ InstanceYesMQ_INST_13801563067\*\*\*\*\*\_BbyOD2jQThe RocketMQ instance ID. Must be in the same region as the MQTT instance.
    TopicYesTopic BThe destination topic on the RocketMQ instance. Messages from the source MQTT topic are forwarded here.

After the rule is created, it appears on the Rules page.

For information about how MQTT messages map to RocketMQ messages, see Message structure mappings between ApsaraMQ for MQTT and ApsaraMQ for RocketMQ.

Edit a data outbound rule

  1. On the Rules page, find the target rule. In the Actions column, choose More > Edit.

  2. On the Edit Rule page, modify any parameter except the rule ID.

  3. Click Save in the Configure Rule Destination step.

Delete a data outbound rule

  1. On the Rules page, find the target rule. In the Actions column, choose More > Delete.

  2. In the confirmation dialog box, click OK.

Enable a data outbound rule

  1. On the Rules page, find the target rule. In the Actions column, choose More > Enable.

  2. In the confirmation dialog box, click OK.

Disable a data outbound rule

  1. On the Rules page, find the target rule. In the Actions column, choose More > Disable.

  2. In the confirmation dialog box, click OK.

Limits

ItemLimitDescription
Rules per instance100To request a higher quota, join DingTalk group 35228338.
Rule deduplicationOne rule of each type per internal resourceEach MQTT topic supports one data inbound rule and one data outbound rule. Each group ID supports one client status notification rule.
Cross-region rulesNot supportedThe MQTT instance (data source) and the RocketMQ instance (data destination) must be in the same region.
MQTT instance versionKernel version V3.x.xRules can only be created on V3.x.x instances.
RocketMQ instance versionApsaraMQ for RocketMQ 4.0Applies to both data inbound and data outbound rules.

See also