This article describes how to configure and manage an AMQP server-side subscription in the IoT Platform console.

Configure a subscription

To set the type of messages to which you want to subscribe, perform the following steps:

  1. Log on to the IoT Platform console.
  2. In the left-side navigation pane, choose Rules > Server-side Subscription.
  3. On the Server-side Subscription page, click Create Subscription.
  4. In the Create Subscription dialog box, set the following parameters and click OK.
    Parameter Description
    Products Select the product to which the devices belong. The messages submitted by these devices are pushed to consumers.
    Subscription Type Select AMQP.
    Consumer Group Select consumer groups. You can specify multiple consumer groups for a product. You can also create multiple subscriptions to products by using a consumer group.

    IoT Platform provides a default consumption group to consume messages. To group consumers, perform the following steps to create a consumer group: In the lower-right corner of the Select Consumer Groups dialog box, click Create Consumer Group and set the required parameters. For more information about consumer groups, see Manage consumer groups.

    Message Type Select the types of messages. You can subscribe to the following types of device messages:
    • Device Upstream Notification: these messages in the topics whose Allowed Operations parameter is set to Publish. For more information, see What is a topic?.

      These messages include custom data and Thing Specification Language (TSL) data that is submitted by devices. The upstream TSL data includes property data, event data, responses to property setting requests, and responses to service calls. The TSL data that is pushed to user servers is processed by IoT Platform. For more information about data formats, see Data formats.

      For example, the following three topics are defined for a product:
      • /${YourProductKey}/${YourDeviceName}/user/get: The Allowed Operations parameter of this topic category is set to Subscribe.
      • /${YourProductKey}/${YourDeviceName}/user/update. The Allowed Operations parameter of this topic is set to Publish.
      • /sys/${YourProductKey}/${YourDeviceName}/thing/event/property/post. The Allowed Operations parameter of this topic is set to Subscribe.

      IoT Platform pushes messages of the following topics: /${YourProductKey}/${YourDeviceName}/user/update and /sys/${YourProductKey}/${YourDeviceName}/thing/event/property/post.

      Note If a device needs to listen to the messages of a custom topic, the device must forward the data of the custom topic to an AMQP consumer group. Then, the device can listen to the required messages through an AMQP client. For more information, see Overview.
    • Device Status Change Notification: the notifications that devices send when the online or offline status changes.
    • Gateway's sub-devices discovery report: the sub-device data that gateways submit when these gateways detect new sub-devices. The gateways must have the applications that can be used to detect sub-devices. This message type is specific to gateways.
    • Device Topological Relation Changes: the notifications that gateways send when topological relationships between sub-devices and the gateways are created or deleted. This message type is specific to gateways.
    • Device Changes Throughout Lifecycle: the notifications that devices send when the devices are created, deleted, enabled, or disabled.
    • TSL Historical Data Reporting: the historical properties and events that are submitted by devices.
    • OTA Update Status Notification: the notifications that devices send during firmware verification and batch update. When a device update task succeeds, fails, is canceled, or is being implemented, a notification is pushed.
    • Device tag change: the messages that devices send when device tags change.
    • Submit a module version number: the message that devices send when OTA module versions change.
    • Batch status notification: the notifications that devices send when the status of OTA update batches changes.

What to do next

Configure an AMQP client

After the settings are configured and submitted device data is received by an AMQP client, you can view the operation logs in the IoT Platform console.Choose Maintenance > Device Log > Cloud run log. The log entries are generated when a device submits data, IoT Platform forwards the data to the AMQP client, and the AMQP client returns an ACK message.