If a device is disconnected, you can use the device trace query feature of ApsaraMQ for MQTT to query the connection history of the device. This helps you troubleshoot issues.
Procedure
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 the instance that you want to manage resides. On the Instances page, click the instance name to go to the Instance Details page.
Find the instance that you want to manage and choose in the Actions column.
On the Device Trace Query page, configure the Group ID, Device ID, and Time Range parameters. Then, click Search.
NoteThe maximum time span is one day.
Parameter
Description
Channel ID
The connection ID.
Device Action
connect: The ApsaraMQ for MQTT client requests a connection to the ApsaraMQ for MQTT broker.
close: The TCP connection is closed.
disconnect: The ApsaraMQ for MQTT client requests a disconnection from the ApsaraMQ for MQTT broker.
Action Description
accepted: The ApsaraMQ for MQTT broker receives the connection request from the ApsaraMQ for MQTT client.
not authorized: The TCP connection is closed because the permission verification of the ApsaraMQ for MQTT client to access the instance fails.
clientId conflict: The TCP connection is closed due to a conflict in the ID of the ApsaraMQ for MQTT client.
topic auth failed: The TCP connection is closed because the permission verification of the ApsaraMQ for MQTT client to access topics fails.
no heart: The TCP connection is closed because no heartbeat is detected on the ApsaraMQ for MQTT client.
closed by client: The TCP connection is closed because an exception occurs on the ApsaraMQ for MQTT client.
NoteThe ApsaraMQ for MQTT client does not send the disconnect message.
disconnected by client: The ApsaraMQ for MQTT client requests a disconnection.
ServerShutdown: The TCP connection is closed due to broker upgrade or broker downtime.
Time
The time when the action occurred on the device.
References
For information about how to query the status of a device, see Query the status of a device.