tencent cloud

DescribeRocketMQTopicMsgs
Last updated: 2025-11-25 10:52:34
DescribeRocketMQTopicMsgs
Last updated: 2025-11-25 10:52:34

1. API Description

Domain name for API request: tdmq.intl.tencentcloudapi.com.

Query RocketMQ messages.

A maximum of 20 requests can be initiated per second for this API.

We recommend you to use API Explorer
Try it
API Explorer provides a range of capabilities, including online call, signature authentication, SDK code generation, and API quick search. It enables you to view the request, response, and auto-generated examples.

2. Input Parameters

The following request parameter list only provides API request parameters and some common parameters. For the complete common parameter list, see Common Request Parameters.

Parameter Name Required Type Description
Action Yes String Common Params. The value used for this API: DescribeRocketMQTopicMsgs.
Version Yes String Common Params. The value used for this API: 2020-02-17.
Region Yes String Common Params. For more information, please see the list of regions supported by the product.
ClusterId Yes String Cluster ID
EnvironmentId Yes String Namespace
TopicName Yes String Topic name, which is groupId when the system queries dead letters.
StartTime Yes String Start time.
EndTime Yes String End time.
MsgId No String Message ID.
MsgKey No String Message key
Offset No Integer Query Offset
Limit No Integer Query Quotas
TaskRequestId No String Mark a pagination transaction.
NumOfLatestMsg No Integer Query the last N messages. The value of N cannot exceed 1024. By default, -1 indicates other query conditions.
Tag No String Tag expression.
QueryDeadLetterMessage No Boolean This value is true when the system queries dead letters, and is only valid for RocketMQ.

3. Output Parameters

Parameter Name Type Description
TotalCount Integer Total number.
TopicMsgLogSets Array of RocketMQMsgLog Message List
TaskRequestId String Mark a pagination transaction.
Note: This field may return null, indicating that no valid values can be obtained.
RequestId String The unique request ID, generated by the server, will be returned for every request (if the request fails to reach the server for other reasons, the request will not obtain a RequestId). RequestId is required for locating a problem.

4. Example

Example1 Obtaining Message List

Input Example

POST / HTTP/1.1
Host: tdmq.intl.tencentcloudapi.com
Content-Type: application/json
X-TC-Action: DescribeRocketMQTopicMsgs
<Common request parameters>

{
    "ClusterId": "rocketmq-zpz97455xwap",
    "EnvironmentId": "test_namespace",
    "TopicName": "test_topic",
    "MsgId": "092BAE5A1656070DEA4E276DF0760089",
    "MsgKey": "test_key",
    "StartTime": "2023-10-08 15:44:59",
    "EndTime": "2023-10-08 16:14:59",
    "Offset": 0,
    "Limit": 20,
    "TaskRequestId": "2e5ecbb3-f2d6-49d3-9c82-8648f8ed8748",
    "QueryDlqMsg": true,
    "NumOfLatestMsg": 0,
    "Tag": "test_tag",
    "QueryDeadLetterMessage": true
}

Output Example

{
    "Response": {
        "RequestId": "e3bba45e-876a-4107-ad5d-88006c1ddba2",
        "TotalCount": 1,
        "TopicMsgLogSets": [
            {
                "MsgId": "092BAE5A1656070DEA4E276DF0760089",
                "MsgTag": "test_tag",
                "MsgKey": "test_key",
                "ProducerAddr": "9.43.174.90",
                "ProduceTime": "2023-10-08 15:45:16",
                "PulsarMsgId": "092BAE5A1656070DEA4E276DF0760089",
                "DeadLetterResendTimes": 10,
                "ResendSuccessCount": 10
            }
        ],
        "TaskRequestId": "df71cc0a-3057-416b-b878-f0fe015e9913"
    }
}

5. Developer Resources

SDK

TencentCloud API 3.0 integrates SDKs that support various programming languages to make it easier for you to call APIs.

Command Line Interface

6. Error Code

The following only lists the error codes related to the API business logic. For other error codes, see Common Error Codes.

Error Code Description
FailedOperation Operation failed.
ResourceNotFound.BrokerCluster The service cluster does not exist.
ResourceNotFound.Cluster The cluster does not exist.
Was this page helpful?
You can also Contact Sales or Submit a Ticket for help.
Yes
No

Feedback