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 a product to which the required devices belong. These devices must be configured to subscribe to some types of messages.
    Subscription Type Select AMQP.
    Consumer Group Select consumer groups. You can select multiple consumer groups as required. If you need to subscribe to multiple products at the same time, you can create multiple subscriptions in a consumer group.

    IoT Platform generates a default consumer group. 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 required message types. 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 pushed to user servers is processed by IoT Platform. For 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 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 succeeds or fails, 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 operations 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.