You can call this operation to create a trace query task based on a specified topic name and message ID to obtain the ID of the query task.
If you have recorded the ID of a message and need to query the delivery trace of the message based on the message ID, you can call this operation to create a query task. After the task ID is returned, the service provider can call the OnsTraceGetResult operation to query the trace query results based on the task ID. For more information about the OnsTraceGetResult operation, see OnsTraceGetResult.
Debugging
Request parameters
Parameter | Type | Required | Example | Description |
---|---|---|---|---|
Action | String | Yes | OnsTraceQueryByMsgId |
The operation that you want to perform. Set the value to OnsTraceQueryByMsgId. |
BeginTime | Long | Yes | 1570852800 |
The beginning of the time range to query. |
EndTime | Long | Yes | 1570968000 |
The end of the time range to query. |
InstanceId | String | Yes | MQ_INST_111111111111_DOxxxxxx |
The ID of the Message Queue for Apache RocketMQ instance corresponding to the topic of the message that you want to query. |
MsgId | String | Yes | 1E05791C117818B4AAC23B1BB0CE**** |
The ID of the message that you want to query. |
Topic | String | Yes | test |
The topic of the message that you want to query. |
Response parameters
Parameter | Type | Example | Description |
---|---|---|---|
QueryId | String | 272967562652883649157096685**** |
The ID of the query task. You can call the OnsTraceGetResult operation to query detailed results based on the task ID. |
RequestId | String | B93332A3-160D-404F-880F-1F8736D1039F |
The ID of the request. This is a common parameter. |
Examples
Sample requests
http(s)://[Endpoint]/? Action=OnsTraceQueryByMsgId
&BeginTime=1570852800
&EndTime=1570968000
&InstanceId=MQ_INST_111111111111_DOxxxxxx
&MsgId=1E05791C117818B4AAC23B1BB0CE****
&Topic=test
&<Common request parameters>
Sample success responses
XML
format
<OnsTraceQueryByMsgIdResponse>
<RequestId>B93332A3-160D-404F-880F-1F8736D1039F</RequestId>
<QueryId>272967562652883649157096685****</QueryId>
</OnsTraceQueryByMsgIdResponse>
JSON
format
{
"RequestId": "B93332A3-160D-404F-880F-1F8736D1039F",
"QueryId": "272967562652883649157096685****"
}
Error codes
For a list of error codes, visit the API Error Center.