tencent cloud

SendRocketMQMessage
Last updated: 2025-11-25 10:52:28
SendRocketMQMessage
Last updated: 2025-11-25 10:52:28

1. API Description

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

This API is used to send messages through RocketMQ. It is only used for sending a small number of test messages from the console and does not provide SLA. Cloud API is subject to traffic throttling. In real business scenarios, use the RocketMQ SDK to send 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: SendRocketMQMessage.
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
NamespaceId Yes String Namespace ID
TopicName Yes String Topic name
MsgBody Yes String Message content
MsgKey No String Message key
MsgTag No String Message tag

3. Output Parameters

Parameter Name Type Description
Result Boolean Message sending result
MsgId String Message ID
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 Sending a Message Example

Input Example

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

{
    "ClusterId": "rocketmq-4k4orqgq",
    "NamespaceId": "test_namespace",
    "TopicName": "test_topic",
    "MsgKey": "test_key",
    "MsgTag": "test_tag",
    "MsgBody": "This is a normal message for Apache RocketMQ"
}

Output Example

{
    "Response": {
        "Result": true,
        "MsgId": "7F0000013AEC18B4AAC278B640D30002",
        "RequestId": "23ca1a58-0388-4d2d-8465-653a53addda7"
    }
}

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.Cluster The cluster does not exist.
ResourceNotFound.Topic The topic does not exist.
ResourceUnavailable.FundRequired You must top up before proceeding.
Was this page helpful?
You can also Contact Sales or Submit a Ticket for help.
Yes
No

Feedback