Fetches the results of a message trace query task using its task ID.
Operation description
After you create a message trace query task by calling the OnsTraceQueryByMsgId or OnsTraceQueryByMsgKey operation, you receive a task ID. You can then call this operation to retrieve the details of the message trace. The task ID is the QueryId that is returned by the creation operation.
Message trace query tasks are time-consuming. If you call this operation immediately after creating a task, the query may return an empty result. If this occurs, wait for a short period and then retry the call.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
mq:GetTraceResult |
get |
*Topic
*Topic
|
None |
|
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| QueryId |
string |
Yes |
The ID of the task for which to fetch the message trace query results. |
272967562652883649157096685**** |
| InstanceId |
string |
No |
The ID of the instance that contains the message you want to query. |
MQ_INST_111111111111_DOxxxxxx |
| Topic |
string |
No |
The topic of the message you want to query. |
test |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
|||
| RequestId |
string |
The ID of the request. This is a common parameter. Each request has a unique ID that you can use to troubleshoot issues. |
84EE24D2-851F-40D6-B99E-4D6AB909**** |
| TraceData |
object |
The details of the query task results. |
|
| Status |
string |
The result of the query task. Valid values:
|
finish |
| MsgKey |
string |
The message key that corresponds to the query task. |
ORDERID_100 |
| UpdateTime |
integer |
The last update time of the query task. |
1570966877000 |
| CreateTime |
integer |
The creation time of the query task. |
1570966857000 |
| Topic |
string |
The topic of the query task. |
test |
| UserId |
string |
The ID of the user who initiated the query. |
27296756265288**** |
| InstanceId |
string |
The instance ID. |
MQ_INST_111111111111_DOxxxxxx |
| MsgId |
string |
The message ID that corresponds to the query task. |
1E05791C117818B4AAC23B1BB0CE**** |
| TraceList |
object |
||
| TraceMapDo |
array<object> |
The list of matched message traces for the query task. |
|
|
array<object> |
|||
| Status |
string |
The sending status. Valid values:
|
SEND_SUCCESS |
| MsgKey |
string |
The message key. |
ORDERID_100 |
| PubTime |
integer |
The time when the message was sent. |
1570850870478 |
| SubList |
object |
||
| SubMapDo |
array<object> |
The list of consumption traces for the message. |
|
|
array<object> |
|||
| ClientList |
object |
||
| SubClientInfoDo |
array<object> |
The list of consumption records for the client that belongs to the group ID. |
|
|
object |
|||
| Status |
string |
The consumption status. Valid values:
|
CONSUME_SUCCESS |
| SubTime |
integer |
The UNIX timestamp for when the consumption started. |
1570851590511 |
| ReconsumeTimes |
integer |
The number of delivery attempts for this consumption. |
1 |
| SubGroupName |
string |
The group ID to which the client belongs. |
GID_test |
| ClientHost |
string |
The address of the consumer client. |
30.5.**.** |
| CostTime |
integer |
The time taken for this consumption, in milliseconds. |
43 |
| FailCount |
integer |
The number of consumption failures for the group ID. |
0 |
| SubGroupName |
string |
The group ID of the consumer. |
GID_test |
| SuccessCount |
integer |
The number of successful consumptions for the group ID. |
1 |
| Topic |
string |
The topic of the message. |
test |
| CostTime |
integer |
The time taken to send the message, in milliseconds. |
24 |
| Tag |
string |
The message tag. |
TagA |
| MsgId |
string |
The message ID. |
0BC1F01800002A9F000000531246**** |
| PubGroupName |
string |
The group ID configured on the producer client. |
GID_test |
| BornHost |
string |
The address of the producer client. |
30.5.**.** |
| QueryId |
string |
The ID of the query task. |
272967562652883649157096685**** |
Examples
Success response
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
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.