IoT Platform provides the data forwarding feature. You can use this feature to execute custom SQL scripts to process the data of a topic to which a device subscribes, and forward the processed data to other topics or other Alibaba Cloud services for storage or subsequent processing.
What is data forwarding?
If your devices use Topics to communicate with other devices and IoT Platform, you can write SQL statements to process the data of the topics. You can also configure data forwarding rules to send the processed data to other topics or Alibaba Cloud services.
|You can forward data to the topics to which another device subscribes for machine-to-machine (M2M) communication.
|Forward data to a topic
|AMQP consumer group
|You can forward device messages to your business server by using an Advanced Message Queuing Protocol (AMQP) consumer group.
|You can forward device data to the Alibaba Cloud services for storage.
|Forward data to ApsaraDB RDS
|Forward data to OTS instances of the Wide Column model
|Forward data to TSDB
|You can forward device data to Message Queue for Apache RocketMQ or Message Service (MNS) to consume the data in a highly reliable manner.
|Forward data to Message Queue for Apache RocketMQ
|Forward data to Message Service (MNS)
|You can forward data to Function Compute to perform event-driven computing.
|Forward data to Function Compute
Data forwarding process
The data forwarding feature allows you to efficiently collect, compute, and store data. You do not need to purchase servers to deploy a distributed architecture.
- IoT Platform allows you to forward device data by using one of the following solutions: server-side subscription or data forwarding. You can select a suitable data forwarding solution based on your business scenario. For more information, see Compare data forwarding features.
- Before you use the data forwarding feature to forward device data to a different Alibaba Cloud service, make sure that the destination cloud service is available in the specified region and supports the format of the forwarded data. For more information, see Regions.
|The maximum number of rules that each Alibaba Cloud account can create.
|Data forwarding destinations
|The maximum number of data forwarding actions that you can specify in a rule.
|Messages processed by the rules engine
After a message is processed, it can be written to multiple Alibaba Cloud services. For more information, see the next item: Messages written to Alibaba Cloud services.
If a message is blocked due to throttling, IoT Platform retries to process the message. If multiple retries fail, the message is discarded.
|Messages written to Alibaba Cloud services
The RAM users of an Alibaba Cloud account share the quota of the account.
If the limit is exceeded or if the number of concurrent write requests to an Alibaba Cloud service exceeds 40, data forwarding fails due to throttling.
If a destination service such as Message Queue for Apache RocketMQ, ApsaraDB RDS, or ApsaraDB for Lindorm is unavailable due to the resource changes of the service, IoT Platform stops forwarding messages and displays the abnormal rule. If an error occurs due to another cause when you send a message, IoT Platform retries three times at the intervals of 1, 3, and 10 seconds. If all retries fail, the message is discarded and an error message is sent to the destination cloud service.
|Requirements of data forwarding destinations
|Make sure that the instance of the destination cloud service runs as expected. Data forwarding fails in multiple scenarios. These scenarios include instance failure, overdue payments, improper configurations, and invalid parameter settings, such as invalid values and lack of permissions.
|When you forward a message, the message may be repeatedly sent until the client returns an ACK message or the message expires. If multiple messages use the same message ID, you can deduplicate the messages based on the ID.
Data forwarding usage guide
- Configure a data forwarding rule: describes how to configure a data forwarding rule.
- SQL statements: describes the SQL statements that can be used in a data forwarding rule.
- Functions: describes the functions that can be used in SQL statements.
- Data forwarding procedure: describes the data forwarding process and the data formats at different stages of data forwarding.
- Data formats: describes the data formats of basic communication topics and TSL-based communication topics. A TSL model is used to parse the data that is sent to a topic. You must write the SQL statements of the data forwarding rules in the data format that is parsed by a TSL model.