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.

Data destinationDescriptionReferences
TopicYou can forward data to the topics to which another device subscribes for machine-to-machine (M2M) communication.Forward data to a topic
AMQP consumer groupYou can forward device messages to your business server by using an Advanced Message Queuing Protocol (AMQP) consumer group.
RDSYou can forward device data to the Alibaba Cloud services for storage. Forward data to ApsaraDB RDS
TablestoreForward data to OTS instances of the Wide Column model
TSDBForward data to TSDB
RocketMQYou 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
MNSForward data to Message Service (MNS)
Function ComputeYou 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.

Data forwarding

Usage notes

  • 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.

Limits

ItemDescriptionLimit
RulesThe maximum number of rules that each Alibaba Cloud account can create. 1,000
Data forwarding destinationsThe maximum number of data forwarding actions that you can specify in a rule. 10
Messages processed by the rules engine
  • The maximum number of data forwarding queries that can be processed per second for a public instance of an Alibaba Cloud account. The RAM users of an Alibaba Cloud account share the quota of the account.
  • The maximum number of messages that the rules engine can process for an Enterprise Edition instance. The value varies based on the specified value of the Rules Engine TPS specification.

    For more information about how to purchase an Enterprise Edition instance, see Purchase Enterprise Edition instances.

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 maximum number of data forwarding queries that can be processed per second for a public instance of an Alibaba Cloud account. The maximum number can be reached only if the instance of an Alibaba Cloud service provides a high level of performance.
  • The maximum number of messages that the rules engine can write from an Enterprise Edition instance to an Alibaba Cloud service. The value varies based on the specified value of the Rules Engine TPS specification.

    For more information about how to purchase an Enterprise Edition instance, see Purchase Enterprise Edition instances.

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 destinationsMake 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. None
Message deduplicationWhen 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. None

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.

References

Data forwarding (new version)