If an exception occurs on an ApsaraMQ for MQTT device or messages cannot be sent or received as expected, use the device status query to check whether the device is online, review its subscriptions, and trace its connection and messaging history. This helps you quickly identify the cause of the issue.
Prerequisites
Before you begin, make sure that you have:
An ApsaraMQ for MQTT instance
The Group ID and Device ID of the device to inspect
Query the device status
Log on to the ApsaraMQ for MQTT console. In the left-side navigation pane, click Instances.
In the top navigation bar, select the region where your instance resides. On the Instances page, click the instance name to go to the Instance Details page.
On the Instances page, find your instance and choose in the Actions column.
On the Device Status Query page, enter the Group ID and Device ID, then click Search.
The query results are organized into three tabs: Device status, Device Trace, and Message Trace.
Understand the query results
Device status tab
The Device status tab shows the current connection state and session configuration of the device.
| Field | Description |
|---|---|
| Client ID | The unique identifier of the MQTT client. |
| Status | The connection state: Online or Offline. |
| Client Address | The IP address of the client. |
| cleanSession | Whether the broker clears previous subscriptions and queued offline messages when the client reconnects. When set to true, the broker starts a clean session each time. When set to false, the broker restores the previous session state, including subscriptions and undelivered messages. For details, see the cleanSession section of the Terms topic. |
| Last Updated At | The timestamp of the most recent status change. |
Subscription section
The Subscription section, displayed below the device status fields, lists all topics the device currently subscribes to.
| Field | Description |
|---|---|
| Parent Topic | The level-1 topic in ApsaraMQ for MQTT that the client subscribes to. |
| Subtopic | The level-2 or level-3 topic under the parent topic. |
| QoS | The quality of service (QoS) level for message delivery between the client and the broker. QoS determines the delivery guarantee: 0 (at most once), 1 (at least once), or 2 (exactly once). For details, see Combinations of QoS levels and the cleanSession parameter. |
Device Trace tab
The Device Trace tab shows the connection history of the device, including connect and disconnect events with timestamps. Use this tab to identify intermittent connectivity issues or unexpected disconnections.
For field descriptions, see Query the connection history of a device.
Message Trace tab
The Message Trace tab shows the message list for the device, including published and received messages. Use this tab to verify whether messages were delivered or to identify missing messages.
For field descriptions, see Query message traces.