You need to enable JavaScript to run this app.
文档中心
消息队列 RocketMQ版

消息队列 RocketMQ版

复制全文
下载 pdf
消息查询
QueryMessageTraceByMessageId - 查询消息轨迹
复制全文
下载 pdf
QueryMessageTraceByMessageId - 查询消息轨迹
调用 QueryMessageTraceByMessageId 接口查询消息轨迹。
调试
API Explorer
您可以通过 API Explorer 在线发起调用,无需关注签名生成过程,快速获取调用结果。
请求参数
下方仅列出该接口特有的请求参数和部分公共参数。更多信息请见公共参数
Action string 必选 示例值:QueryMessageTraceByMessageId
要执行的操作,取值:QueryMessageTraceByMessageId。
Version string 必选 示例值:2023-01-01
API的版本,取值:2023-01-01。
Topic string 必选 示例值:topic-test
业务消息的 topic 名称。
MessageId string 必选 示例值:FDBDDC420003019700000000000000390017014AE5A51A6D2B75****
消息 ID。
QueryStartTimestamp long 必选 示例值:1739603639
业务消息的起始时间戳,单位秒,如业务消息是 08 秒生产的,那么查询时需要指定 08 秒以前的时间。
QueryEndTimestamp long 必选 示例值:1739862839
消息查询的最后时间戳,单位秒,与QueryStartTimestamp参数配合使用,用来控制消息查询的时间范围。
NeedProduceTraceInfo boolean 必选 示例值:true
是否需要生产者的消息轨迹。
MessageBornTimestamp long 可选 示例值:1739862800
消息产生的时间戳,单位秒。
InstanceId string 必选 示例值:rocketmq-cnoed031c6f3****
实例 ID。
返回参数
下方仅列出本接口特有的返回参数。更多信息请参见返回结构
ProducerTraceInfo object[] 示例值:详情请参见返回示例
生产者消息轨迹详情。
MessageBornHost string 示例值:100.xx.xx.xx:612
生产者地址。
MessageBornTimestamp long 示例值:1739862800
消息产生的时间戳,单位为 s。
SendCostTimeMs integer 示例值:3
消息发送耗时,单位为 ms。
SendStatus string 示例值:SEND_OK
消息发送状态。
ConsumerTraceInfos object[] 示例值:详情请参见返回示例
消费者轨迹详情。
ConsumerHost string 示例值:10.200.2xx.1xx@91050
消费者客户端地址。
StartProcessTimestamp long 示例值:1739862800
开始消费消息的时间,单位为 s。
EndProcessTimestamp long 示例值:1739862801
消费完成的时间,单位为 s。
ProcessCostTimeMs integer 示例值:3
消费消息耗时,单位为 ms。
ReconsumeTimes integer 示例值:2
重试消费次数。
GroupName string 示例值:group-test
消费组名称。
ConsumeStatus string 示例值:CONSUME_SUCCESS
消费状态,成功或者失败。
ConsumeSuccess boolean 示例值:true
消费是否成功。
请求示例
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****"
}
返回示例
{
"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
}
]
}
}
错误码
下表为您列举了该接口与业务逻辑相关的错误码。公共错误码请参见公共错误码文档。
状态码
错误码
错误信息
说明
400
InvalidPara
The specified parameter is not valid.
参数值无效。
400
TopicNotExist
The specified topic does not exist.
Topic 不存在。
400
OperationDenied.InvalidRequest
The request that you specified is not valid.
请求异常,请检查后重试。
404
InvalidMessageId.NotFound
The message ID does not exist in the instance %s.
Message ID 不存在。
500
ServerInternalError
The request failed due to some unknown error, exception or failure.
服务内部错误。
503
ServiceUnavailable
The request failed due to a temporary failure of the server.
当前服务暂时不可用。
最近更新时间:2026.02.13 18:31:53
这个页面对您有帮助吗?
有用
有用
无用
无用