Create a queue

Last updated: 2020-06-08 15:53:07

    Note:

    This is a legacy API which has been hidden and will no longer be updated. We recommend using the new CMQ API 3.0 which is standardized and faster.

    Interface description

    This API (CreateQueue) is used to create a new queue under a user account.

    • Domain name requested by public network API: https://cmq-queue-{$region}.api.qcloud.com
    • Domain name requested by private network API: http://cmq-queue-{$region}.api.tencentyun.com

    The above {$region} in the domain name needs to be replaced with a specific region : gz (Guangzhou), sh (Shanghai), bj (Beijing), shjr (Shanghai Finance), szjr (Shenzhen Finance), hk (Hong Kong, China), cd (Chengdu), ca (North America), usw (American West), sg (Singapore). The region value in the common parameters should be consistent with the region value of the domain name. If there is any inconsistency, the request will be sent to the region specified by the domain name region based on the region value of the domain name.

    At any time (including during internal testing), if the public network downstream Traffic is generated by using a public network domain name, Traffic and cost will be charged. Therefore, it is strongly recommended that users of the service on Tencent Cloud use Private network Domain name, private network will not produce Traffic cost.

    Input Parameter

    The following request parameter list only lists the API request parameters. For other parameters, please see Common Request Parameters page.

    Parameter name Required Type Description
    QueueName Yes String Queue name, which is unique under the same account in a single region. The queue name is a string of no more than 64 characters, must begin with a letter, and the rest can contain letters, numbers, and dashes (-).
    MaxMsgHeapNum No Int Maximum number of heap messages. The range of values during the public test period is 1,000,000 - 10,000,000 The range can be reached after the official Activate 1000,000-1000,000,000 . The default value during public testing is 10,000,000 After Activate, it is officially called 100,000,000 .
    PollingWaitSeconds No Int Long-polling Waiting Time for Message Receipt. The value range is 200ms-30s, and the default is 200ms.
    VisibilityTimeout No Int Message visibility timed out. Value range: 1-43200 seconds (that is, within 12 hours). The default value is 30.
    MaxMsgSize No Int Max Message Length. Value range: 1024-1048576 Byte (that is, 1-1024K), with a default value of 65536.
    MsgRetentionSeconds No Int Message Lifecycle. Value range: 60-1296000 seconds (1min-15 days). Default is 345600 (4 days).
    RewindSeconds No Int The maximum rewind time of the message in rewind queue, which ranges from 0 to 43200 seconds. 0 means the message rewind is not enabled.

    Output Parameter

    Parameter name Type Description
    Code Int 0: indicates success. Others: error. For more information, please see Common error code .
    Message String Error message.
    RequestId String Request ID generated by the server. When an internal error occurs on the server, the user can submit this ID to Backend Background to locate the problem.
    QueueId String The unique identification ID of the queue.

    Error Codes

    Please check Common error code .

    Example

    Enter:

    Https://domain/v2/index.php?Action=CreateQueue & queueName=test-queue-123 & <Common Request Parameters>

    Output:

    {
    "code" : 0,
    "message" : "",
    "requestId":"14534664555",
    "queueId":"queue-ajksdfasdowe"
    }

    Was this page helpful?

    Was this page helpful?

    • Not at all
    • Not very helpful
    • Somewhat helpful
    • Very helpful
    • Extremely helpful
    Send Feedback
    Help