tencent cloud

消息队列 Pulsar 版

动态与公告
新功能发布记录
集群版本更新记录
产品公告
产品简介
TDMQ 产品系列介绍与选型
什么是消息队列 Pulsar 版
产品优势
应用场景
技术原理
产品系列
开源 Pulsar 版本支持说明
与开源 Pulsar 对比
高可用
配额与限制
基础概念
产品计费
计费概述
价格说明
计费示例
续费说明
查看消费明细
欠费说明
退费说明
快速入门
入门流程指引
准备工作
使用 SDK 收发普通消息
使用 SDK 收发高级特性消息
用户指南
使用流程指引
配置账号权限
新建集群
配置命名空间
配置 Topic
连接集群
管理集群
查询消息及轨迹
跨地域复制
查看监控和配置告警
实践教程
客户端使用实践
异常消费者隔离
限流机制说明
交易对账
消息幂等性
消息压缩
迁移指南
单写多读集群迁移方案
虚拟集群平滑迁移至专业集群
API 参考
API 概览
SDK 参考
SDK 概述
SDK 配置参数推荐
TCP 协议(Pulsar 社区版)
安全与合规
权限管理
删除保护
云 API 审计
常见问题
监控相关
客户端相关
服务协议
服务等级协议
TDMQ 政策
联系我们
词汇表
文档消息队列 Pulsar 版

CreateCmqQueue

聚焦模式
字号
最后更新时间: 2025-11-25 10:54:59

1. API Description

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

This API is used to create a CMQ queue.

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: CreateCmqQueue.
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. This API only supports: ap-bangkok, ap-beijing, ap-chengdu, ap-chongqing, ap-guangzhou, ap-hongkong, ap-nanjing, ap-seoul, ap-shanghai, ap-shanghai-fsi, ap-shenzhen-fsi, ap-singapore, ap-tokyo, eu-frankfurt, na-ashburn, na-siliconvalley, sa-saopaulo.
QueueName Yes String Queue name, which is unique under the same account in a single region. It is a string of up to 64 characters. It can contain letters, digits, and hyphens (-) and must start with a letter.
MaxMsgHeapNum No Integer Maximum number of heaped messages. The value range is 1,000,000–10,000,000 during the beta test and can be 1,000,000–1,000,000,000 after the product is officially released. The default value is 10,000,000 during the beta test and will be 100,000,000 after the product is officially released.
PollingWaitSeconds No Integer Long polling wait time for message reception. Value range: 0–30 seconds. Default value: 0.
VisibilityTimeout No Integer Message visibility timeout period. Value range: 1–43200 seconds (i.e., 12 hours). Default value: 30.
MaxMsgSize No Integer Maximum message length. value range: 1024-1048576 Byte (1-1024K). default value: 1048576.
MsgRetentionSeconds No Integer The max period during which a message is retained before it is automatically acknowledged. Value range: 30-43,200 seconds (30 seconds to 12 hours). Default value: 3600 seconds (1 hour).
RewindSeconds No Integer Rewindable time of messages in the queue. Value range: 0-1,296,000s (if message rewind is enabled). The value “0” indicates that message rewind is not enabled.
Transaction No Integer 1: transaction queue; 0: general queue
FirstQueryInterval No Integer First lookback interval
MaxQueryCount No Integer Maximum number of lookbacks
DeadLetterQueueName No String Dead letter queue name
Policy No Integer Dead letter policy. 0: message has been consumed multiple times but not deleted; 1: Time-To-Live has elapsed
MaxReceiveCount No Integer Maximum receipt times. Value range: 1–1000
MaxTimeToLive No Integer Maximum period in seconds before an unconsumed message expires, which is required if policy is 1. Value range: 300–43200. This value should be smaller than msgRetentionSeconds (maximum message retention period)
Trace No Boolean Whether to enable message trace. true: yes; false: no. If this field is not configured, the feature will not be enabled
Tags.N No Array of Tag Tag array.
RetentionSizeInMB No Integer Queue storage space configured for message rewind. Value range: 10,240-512,000 MB (if message rewind is enabled). The value “0” indicates that message rewind is not enabled.

3. Output Parameters

Parameter Name Type Description
QueueId String queueId of a successfully created queue
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 Example

This example shows you how to create a queue.

Input Example

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

{
    "QueueName": "test789"
}

Output Example

{
    "Response": {
        "RequestId": "864b1295-ed7e-45ed-9602-be53ac23177b",
        "QueueId": "cmqq-rd42drdeaag9"
    }
}

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.
FailedOperation.CreateCluster Failed to create the cluster.
FailedOperation.CreateTopic Failed to create the topic.
FailedOperation.SetRetentionPolicy Failed to set the message retention policy.
FailedOperation.SetTTL Failed to configure the message TTL.
InternalError.BrokerService The broker service is exceptional.
ResourceInUse The resource is in use.
ResourceInUse.Queue The queue already exists.
ResourceNotFound.Environment The environment does not exist.
ResourceUnavailable The resource is unavailable.
ResourceUnavailable.CreateFailed Assignment exception.
ResourceUnavailable.FundRequired You must top up before proceeding.
UnsupportedOperation Unsupported operation.

帮助和支持

本页内容是否解决了您的问题?

填写满意度调查问卷,共创更好文档体验。

文档反馈