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

Configure subscription

To set the type of messages that you want to subscribe in the IoT Platform console, perform these steps:

  1. Log on to the IoT Platform console.
  2. In the left-side navigation pane, choose Rules > Server-side Subscription.
  3. On the Subscriptions tab of the Server-side Subscription page, click Create Subscription.
  4. In the Create Subscription dialog box that appears, set the following parameters and click OK.
    AMQP IoT
    Parameter Description
    Product Select the product to which the devices whose messages are subscribed belongs.
    Subscription Type Select AMQP.
    Consumer Group You can select multiple consumer groups.

    IoT Platform generates a default consumer group. If you want to group consumers, click Create Consumer Group to create a consumer group. For information about consumer groups, see the "Consumer groups" section in this topic.

    Push message type Select the types of messages that you want to subscribe to. Currently, you can subscribe to the following types of device messages:
    • Device Upstream Notification: Messages that devices publish. If you select this option, you can use the AMQP SDK to receive messages published by devices.

      This type of messages includes custom data and Thing Specification Language (TSL) data reported by devices. The data includes property data, event data, property setting responses, and service invocation responses. TSL data pushed to the server has been processed by IoT Platform. For information about the data format, see Data formats.

      For example, assume that a product has three topic categories:
      • /${YourProductKey}/${YourDeviceName}/user/get: Devices can subscribe to this topic.
      • /${YourProductKey}/${YourDeviceName}/user/update: Devices can publish messages to this topic.
      • /sys/${YourProductKey}/${YourDeviceName}/thing/event/property/post: Devices can publish messages to this topic.

      The server-side subscription function forwards messages in topic categories /${YourProductKey}/${YourDeviceName}/user/update and /sys/${YourProductKey}/${YourDeviceName}/thing/event/property/post to your server.

    • Device Status Change Notification: Notifications that are sent when the device status (online/offline) changes.
    • Gateway's Sub-device Discovery Reporting: Information about discovered sub-devices, which is reported by gateways to IoT Platform. This requires the support of applications on the gateway. This message type is specific to gateways.
    • Device Topological Relation Changes: Notifications about the creation and removal of topological relationships between devices and gateways. This message type is specific to gateways.
    • Device Changes Throughout Lifecycle: Messages about device creation, deletion, disabling, and enabling.
    • TSL Historical Data Reporting: Historical data of properties and events reported by devices.
    • Firmware Update Status Notification: Notifications of firmware update results.

Consumer groups

Create consumer groups based on your business needs to manage subscriptions and monitor message consumption.

Each consumer group has a unique ID on IoT Platform. You must configure a consumer group ID on the AMQP client before the client can access IoT Platform and receive subscribed messages.

Multiple clients can share a consumer group ID. They form a consumer group. When a device message arrives, IoT Platform sends it to a client in the consumer group. A consumer group can have up to 64 clients.

Create and manage consumer groups.

  • Create a consumer group.
    1. On the Server-side Subscription page, choose Consumer Groups > Create Consumer Group.
    2. In the Create Consumer Group dialog box that appears, enter a group name and click OK.
  • Manage consumer groups.

    You can manage and monitor server-side subscription by consumer groups.

    Click View in the Actions column corresponding to a consumer group. The Consumer Group Details page appears. On this page, you can perform the following operations:

    • Manage server-side subscription.

      On the Subscribed Products tab, you can add subscriptions to the consumer group, change the subscribed message type, and cancel subscription.

    • Monitor the consumption of subscribed messages.

      On the Consumer Group Status tab, you can view the message consumption rate, number of accumulated messages, last consumption time, and online client list.



AMQP client access instructions

Java SDK access example

Node.js SDK access example

.NET SDK access example

Python SDK access example