You need to enable JavaScript to run this app.
Message Queue for RocketMQ

Message Queue for RocketMQ

Copy page
Download PDF
Message query
QueryMessageTraceByMessageId - Query message trace
Copy page
Download PDF
QueryMessageTraceByMessageId - Query message trace
Call the QueryMessageTraceByMessageId API to query the message trace.​
Debug​
API Explorer
You can initiate calls online through API Explorer without paying attention to the signature generation process and quickly obtain the call results.
​
Request parameters​
Only the unique request parameters of this interface and some common parameters are listed below. For more information, see common parameters.​
Action string required Example value: QueryMessageTraceByMessageId​
Operation to perform. Value: QueryMessageTraceByMessageId.​
​
Version string required Example: 2023-01-01​
API version, value: 2023-01-01.​
​
Topic string requiredExample value: topic-test​
Topic name of the business message.​
​
MessageId string required Example: FDBDDC420003019700000000000000390017014AE5A51A6D2B75****​
Message ID.​
​
QueryStartTimestamp long required Example value: 1739603639​
The starting timestamp of business messages, measured in seconds. For example, if a business message is produced at second 08, specify a time prior to second 08 when querying.​
​
QueryEndTimestamp long required Example value: 1739862839​
The last timestamp for message query, in seconds. Use with QueryStartTimestamp to set the query time range.​
​
NeedProduceTraceInfo boolean requiredExample value: true​
Whether the producer’s message trace is required.​
​
MessageBornTimestamp long Optional Example: 1739862800​
Message creation timestamp in seconds.​
​
InstanceId string required Example value: rocketmq-cnoed031c6f3****​
Instance ID.​
​
​
​
Response parameters​
Only the unique response parameters of this API are listed below. For more details, see response structure.​
ProducerTraceInfo object[] Example value: For details, see the response example​
Producer message trace details.​
MessageBornHost string Example value: 100.xx.xx.xx:612​
Producer address.​
​
MessageBornTimestamp long Example value: 1739862800​
Timestamp when the message was generated, in seconds.​
​
SendCostTimeMs integer Sample value: 3​
Message sending duration, measured in ms.​
​
SendStatus string Example value: SEND_OK​
Message send status.​
​
​
ConsumerTraceInfos object[] Example value: See the response example for details​
Consumer trace details.​
ConsumerHost string Example value: 10.200.2xx.1xx@91050​
The consumer client address.​
​
StartProcessTimestamp long Example value: 1739862800​
The time when message consumption begins, measured in seconds.​
​
EndProcessTimestamp long Example value: 1739862801​
Time when consumption is completed, in seconds.​
​
ProcessCostTimeMs integer Example value: 3​
Time taken to consume messages, measured in ms.​
​
ReconsumeTimes integer Example: 2​
Retry consumption count.​
​
GroupName string Example value: group-test​
Consumer group name.​
​
ConsumeStatus string Example: CONSUME_SUCCESS​
Consumption status, success or failure.​
​
ConsumeSuccess boolean Example value: true​
Whether the consumption was successful.​
​
​
​
​
Request example​
​
POST /?Action=QueryMessageTraceByMessageId&Version=2023-01-01 HTTP/1.1​
Host: rocketmq.cn-beijing.volcengineapi.com​
Content-Type: application/json; charset=UTF-8​
X-Date: 20260112T095453Z​
X-Content-Sha256: 287e874e******d653b44d21e​
Authorization: HMAC-SHA256 Credential=Adfks******wekfwe/20260112/cn-beijing/RocketMQ/request, SignedHeaders=host;x-content-sha256;x-date, Signature=47a7d934ff7b37c03938******cd7b8278a40a1057690c401e92246a0e41085f​
​
{​
"Topic": "topic-test",​
"MessageId": "FDBDDC420003019700000000000000390017014AE5A51A6D2B75****",​
"QueryStartTimestamp": 1739603639,​
"QueryEndTimestamp": 1739862839,​
"NeedProduceTraceInfo": true,​
"InstanceId": "rocketmq-cnoed031c6f3****"​
}​
​
Response example​
​
{​
"ResponseMetadata": {​
"RequestId": "2026011217545914614415700942****",​
"Action": "QueryMessageTraceByMessageId",​
"Version": "2023-01-01",​
"Service": "RocketMQ",​
"Region": "cn-beijing"​
},​
"Result": {​
"ProducerTraceInfo": [​
{​
"MessageBornHost": "100.xx.xx.xx:612",​
"MessageBornTimestamp": 1739862800,​
"SendCostTimeMs": 3,​
"SendStatus": "SEND_OK"​
}​
],​
"ConsumerTraceInfos": [​
{​
"ConsumerHost": "10.200.2xx.1xx@91050",​
"StartProcessTimestamp": 1739862800,​
"EndProcessTimestamp": 1739862801,​
"ProcessCostTimeMs": 3,​
"ReconsumeTimes": 2,​
"GroupName": "group-test",​
"ConsumeStatus": "CONSUME_SUCCESS",​
"ConsumeSuccess": true​
}​
]​
}​
}​
​
Error code​
The following table lists error codes related to this interface and business logic. Refer to the Public error codes section for common error codes.​
​
Status code​
Error code​
Error message​
description​
400​
InvalidPara​
The specified parameter is not valid.​
The parameter value is invalid.​
400​
TopicNotExist​
The specified topic does not exist.​
Topic does not exist.​
400​
OperationDenied.InvalidRequest​
The request that you specified is not valid.​
Request exception. Please check and try again.​
404​
InvalidMessageId.NotFound​
The message ID does not exist in the instance %s.​
Message ID does not exist.​
500​
ServerInternalError​
The request failed due to some unknown error, exception or failure.​
Internal service error.​
503​
ServiceUnavailable​
The request failed due to a temporary failure of the server.​
The current service is temporarily unavailable.​
​
Last updated: 2026.02.09 11:47:46