This article describes how to manage data inbound rules in the Message Queue for MQTT console.

Create a data inbound rule

For more information about the limits on rules, see Limits.

  1. Log on to the Message Queue for MQTT console.
  2. In the left-side navigation pane, click Instances.
  3. In the top navigation bar, select a region.
  4. Find the instance for which you want to create a data inbound rule in the instance list. In the Actions column, choose More > Rules.
  5. In the upper-left corner of the Rules page, click Create Rule.
  6. On the Create Rule page, perform the following steps:
    1. In the Configure Basic Information step, set the following parameters and click Next.
      Parameter Example Description
      Rule ID 111111 The global unique identifier of a rule.
      • It can contain only letters, digits, hyphens (-), and underscores (_) and must contain at least one letter or digit.
      • It must be 3 to 64 characters in length. If the value contains more than 64 characters, it is automatically truncated.
      • It cannot be updated after the rule is created.
      Description migrate from rocketmq The description of the rule.
      Status Enable Specifies whether to enable the current rule. Valid values:
      • Enable
      • Disable
      Rule Type Data Inbound The type of the rule. Valid values:
    2. In the Configure Rule Source step, specify the data source and click Next.
      Parameter Example Description
      Source Service Type Message Queue for Apache RocketMQ The cloud service from which the data is forwarded to Message Queue for MQTT.
      Note Only Message Queue for Apache RocketMQ is supported.
      Message Queue for Apache RocketMQ Instance MQ_INST_13801563067*****_BbyOD2jQ The ID of the Message Queue for Apache RocketMQ instance from which the data is forwarded.
      Topic TopicA The Message Queue for Apache RocketMQ topic from which the data is forwarded. In this example, the messages of TopicA are forwarded to a topic in Message Queue for MQTT.
    3. In the Configure Rule Destination step, specify the source from which the data is forwarded and click Create.
      Parameter Example Description
      Topic TpoicB The topic in Message Queue for MQTT to which the data is forwarded from other Alibaba Cloud services.
    You can view the data inbound rule that you create on the Rules page.
Note For more information about the message structure mappings between Message Queue for MQTT and Message Queue for Apache RocketMQ, see Message structure mappings between Message Queue for MQTT and Message Queue for Apache RocketMQ.

Edit a data inbound rule

  1. Log on to the Message Queue for MQTT console.
  2. In the left-side navigation pane, click Instances.
  3. In the top navigation bar, select a region.
  4. Find the instance for which you want to create a data outbound rule in the instance list. In the Actions column, choose More > Rules.
  5. In the rule list, find the rule that you want to edit. In the Actions column, choose More > Edit.
  6. On the Edit Rule page, you can change all parameter values except the rule ID.
  7. After you change parameter values as needed, click Save in the Configure Rule Destination step.

Delete a data inbound rule

  1. Log on to the Message Queue for MQTT console.
  2. In the left-side navigation pane, click Instances.
  3. In the top navigation bar, select a region.
  4. Find the instance for which you want to create a data outbound rule in the instance list. In the Actions column, choose More > Rules.
  5. In the rule list, find the rule that you want to delete. In the Actions column, choose More > Delete.
  6. In the message that appears, click OK.

Enable a data inbound rule

  1. Log on to the Message Queue for MQTT console.
  2. In the left-side navigation pane, click Instances.
  3. In the top navigation bar, select a region.
  4. Find the instance for which you want to create a data outbound rule in the instance list. In the Actions column, choose More > Rules.
  5. In the rule list, find the rule that you want to enable. In the Actions column, choose More > Enable.
  6. In the message that appears, click OK.

Disable a data inbound rule

  1. Log on to the Message Queue for MQTT console.
  2. In the left-side navigation pane, click Instances.
  3. In the top navigation bar, select a region.
  4. Find the instance for which you want to create a data outbound rule in the instance list. In the Actions column, choose More > Rules.
  5. In the rule list, find the rule that you want to disable. In the Actions column, choose More > Disable.
  6. In the message that appears, click OK.