You can forward data that is processed by an SQL rule to another topic. This implements machine-to-machine (M2M) communication or other communication scenarios.

Prerequisites

A data forwarding rule is created and an SQL statement that is used to process data is written. For more information, see Configure data forwarding rules.

Background information

The data forwarding feature of the rules allows you to forward data from Topic 1 to Topic 2.

The following figure shows the data forwarding procedure.

Forward data to a topic

Procedure

  1. Log on to the IoT Platform console.
  2. In the left-side navigation pane, choose Rules > Data Forwarding.
  3. Click View next to the required rule. The Data Forwarding Rule page appears.
  4. In the Data Forwarding section, click Add Operation.
  5. In the Add Operation dialog box, select Publish to another Topic in the Select Operation field. Set the required parameters as prompted and click OK.
    Publish data to another topic
    Parameter Description
    Select Operation Select Publish to another Topic.
    Topic Select the destination topic to which data is forwarded.

    Valid values:

    • Custom: specifies a custom topic as the destination topic. You must set the permission of the custom topic to subscribe. This allows the related devices to subscribe to the topic and obtain forwarded messages from the topic.
    • TSL Data Pushing: specifies a topic that is used by the related devices to receive commands as the destination topic. These commands are used to set device properties. By default, the topic is thing/service/property/set. A device receives forwarded data from the topic. Then, the device sets the required property based on the specified data content. This topic is used when you want to specify the properties for the related devices of the destination topic based on forwarded data.

    After you select a topic type, you must select a product, device, and topic.

  6. Go to the Data Forwarding page, find the required rule, and then click Start in the Actions column of the rule.