The tracing results are queried by specifying the ID of a trace query task.
Operation description
Note
API operations provided by Alibaba Cloud are used to manage and query resources of Alibaba Cloud services. We recommend that you integrate these API operations only in management systems. Do not use these API operations in the core system of messaging services. Otherwise, system risks may occur.
- Before you call this operation to query the details of the trace of a message, you must create a task to query the trace of the message based on the message ID or message key and obtain the task ID. Then, you can call this operation to query the details of the message trace based on the task ID. You can call the OnsTraceQueryByMsgId operation or the OnsTraceQueryByMsgKey operation to create a task to query the trace of the message and obtain the task ID from the QueryId response parameter.
- A trace query task is time-consuming. If you call this operation to query the details immediately after you create a trace query task, the results may be empty. In this case, we recommend that you try again later.
Debugging
Authorization information
There is currently no authorization information disclosed in the API.
Request parameters
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
QueryId | string | Yes | The ID of the task that was created to query the trace of the message. | 272967562652883649157096685**** |
InstanceId | string | No | The ID of the instance to which the message you want to query belongs. | MQ_INST_111111111111_DOxxxxxx |
Topic | string | No | The topic to which the message belongs. | test |
Response parameters
Examples
Sample success responses
JSON
format
{
"RequestId": "84EE24D2-851F-40D6-B99E-4D6AB909****",
"TraceData": {
"Status": "finish",
"MsgKey": "ORDERID_100",
"UpdateTime": 1570966877000,
"CreateTime": 1570966857000,
"Topic": "test",
"UserId": "27296756265288****",
"InstanceId": "MQ_INST_111111111111_DOxxxxxx",
"MsgId": "1E05791C117818B4AAC23B1BB0CE****",
"TraceList": {
"TraceMapDo": [
{
"Status": "SEND_SUCCESS",
"MsgKey": "ORDERID_100",
"PubTime": 1570850870478,
"SubList": {
"SubMapDo": [
{
"ClientList": {
"SubClientInfoDo": [
{
"Status": "CONSUME_SUCCESS",
"SubTime": 1570851590511,
"ReconsumeTimes": 1,
"SubGroupName": "GID_test",
"ClientHost": "30.5.**.**",
"CostTime": 43
}
]
},
"FailCount": 0,
"SubGroupName": "GID_test",
"SuccessCount": 1
}
]
},
"Topic": "test",
"CostTime": 24,
"Tag": "TagA",
"MsgId": "0BC1F01800002A9F000000531246****",
"PubGroupName": "GID_test",
"BornHost": "30.5.**.**"
}
]
},
"QueryId": "272967562652883649157096685****"
}
}
Error codes
For a list of error codes, visit the Service error codes.
Change history
Change time | Summary of changes | Operation | ||||||
---|---|---|---|---|---|---|---|---|
2024-03-19 | The request parameters of the API has changed | see changesets | ||||||
|
Query the trace of a message in the console
You can also query the trace of a message in the ApsaraMQ for RocketMQ console.**** For more information, see Query a message trace.