All Products
Search
Document Center

ApsaraMQ for MQTT:Query the status of a device

Last Updated:Mar 11, 2026

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

  1. Log on to the ApsaraMQ for MQTT console. In the left-side navigation pane, click Instances.

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

  3. On the Instances page, find your instance and choose More > Device Status Query in the Actions column.

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

FieldDescription
Client IDThe unique identifier of the MQTT client.
StatusThe connection state: Online or Offline.
Client AddressThe IP address of the client.
cleanSessionWhether 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 AtThe 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.

FieldDescription
Parent TopicThe level-1 topic in ApsaraMQ for MQTT that the client subscribes to.
SubtopicThe level-2 or level-3 topic under the parent topic.
QoSThe 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.

See also