Add a data source
You can use the Data Forwarding feature in IoT Platform to forward messages from specific device topics to other topics, business servers, or other Alibaba Cloud services for processing, filtering, storage, and analysis. The feature uses a parser script to link a data source (device messages) to a data forwarding destination.
How it works
You can configure a Data Forwarding parser in IoT Platform to forward data from a data source (device messages) to a data forwarding destination, such as another topic, an AMQP server, or another Alibaba Cloud service. This enables communication between devices, between devices and servers, and between devices and Alibaba Cloud services.
Limits
-
For information about the topic types that a data source supports, see Data formats, Messaging for devices that use open source MQTT, Messaging for devices that use JT/T 808, Messaging for devices that use GB/T 32960, and SL 651 protocol message examples.
-
You can add up to 1,000 message topics to each data source.
-
For a list of functions that you can use in a parser script to process data from a data source, see Function list.
You can use the
topic(n)function in a script to get the source topic of a message.
Add a data source
Log on to the IoT Platform console.
On the Overview page, find the instance that you want to manage and click the instance ID or instance name.
In the navigation pane on the left, choose .
-
On the Data Forwarding page, click Go to New Version in the upper-right corner.
NoteIf you have performed this operation before, you are automatically redirected to the new version of the Data Forwarding page.
-
Click the Data Source tab, and then click Create Data Source.
-
Enter a name and description for the data source, and then click OK.
The name must be 1 to 30 characters long and can contain Chinese characters, Japanese characters, letters, digits, underscores (_), and hyphens (-). A Chinese or Japanese character counts as two characters.
After the data source is created, the console redirects you to the Data Source Details page. On this page, you can click Edit to modify its name and description, or click Add Topic to add message topics.
-
On the Data Source Details page, click Add Topic. In the dialog box that appears, select the message topics to process and then click OK.
For more information about the supported topics, see Data formats.
ImportantFor open source MQTT-hosted products and devices, and cloud gateway products and devices, you can select only Custom, Device Status Change Notification, and Device Lifecycle Change topics. For more information about message forwarding topics and data formats, see Messaging for devices that use open source MQTT, Messaging for devices that use JT/T 808, Messaging for devices that use GB/T 32960, and Overview of the SL 651 protocol.
-
Optional: Repeat the previous step to add more message topics to the data source.
After adding topics, you can manage them on the Data Source Details page. The list shows all configured topics, such as TSL Data Reporting (Topic path:
/<productKey>//+/thing/event/property/post) and Device Status Change Notification (Topic path:/as/mqtt/status/<productKey>/+). To remove a topic, click Delete next to it.
Next steps
Related APIs
|
API |
Description |
|
Creates a data source for data forwarding. |
|
|
Updates the name and description of a data source. |
|
|
Queries all data sources. |
|
|
Queries the details of a specific data source. |
|
|
Deletes a data source. |
|
|
Adds a topic to a data source. |
|
|
Queries the topics in a data source. The results are paginated. |
|
|
Deletes a topic from a data source. |
FAQ
-
How can I determine the source topic of a message received by the ApsaraMQ for MNS server?
-
How do I implement device connection and status synchronization on IoT Platform?
-
How can I notify an app or a mini program after a device goes online?
-
Can I use an AMQP server to subscribe to hexadecimal data reported by devices?