tencent cloud

Feedback

Get queue properties

Last updated: 2021-04-06 19:20:57

    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 (GetQueueAttributes) is used to obtain the attributes of a created queue. In addition to the settable properties set when the queue is created, you can also get the queue creation time, the last time the queue property was modified, and the Statistics (approximate value) of the message in the queue.

    • 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.

    Note:

    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, users of the service on Tencent Cloud are strongly recommended to use it. 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 (-).

    Output Parameter

    Parameter name Type Description
    Code Int 0: successful. 4440: queue does not exist. The meaning of other return values can be found in Error Codes .
    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.
    MaxMsgHeapNum 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 Int Long-polling Waiting Time for Message Receipt. The value range is 0-30 seconds, and the default value is 0.
    VisibilityTimeout Int Message visibility timed out. Value range: 1-43200 seconds (that is, within 12 hours). The default value is 30.
    MaxMsgSize Int Max Message Length. Value range: 1024-1048576 Byte (that is, 1K-1024K), with a default value of 65536.
    MsgRetentionSeconds Int Message retention cycle. The value range is 60 mi 1296000 seconds (1min-15 days), and the default value is 345600 seconds (4 days).
    CreateTime Int The time when the queue was created. Returns Unix timestamp, accurate to seconds.
    LastModifyTime Int When the queue property was last modified. Returns Unix timestamp, accurate to seconds.
    ActiveMsgNum Int The total number of messages in the queue in the Active state (not in the consumed state), which is an approximate value.
    InactiveMsgNum Int The total number of messages in the queue in the Inactive state (being consumed), which is an approximate value.
    RewindSeconds 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.
    RewindmsgNum Int The number of messages that have been deleted by calling the API DelMsg, but are still in rewind's retention time.
    MinMsgTime Int The minimum unconsumed time of the message, in seconds.
    QueueName String The name of the message queue.
    QueueId String Message queuing ID.
    CreateUin Int Created by Uin.
    Bps Int Bandwidth limit.
    QPS Int The limit on the number of messages produced per second, and the size of consumption messages is 1.1 times this value.
    Tags Array Associate's label.

    Example

    Enter:

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

    Output:

    {
        "code": 0,
        "message": "",
        "codeDesc": "Success",
        "requestId": "1661914201",
        "maxMsgHeapNum": 100000000,
        "pollingWaitSeconds": 3,
        "visibilityTimeout": 43200,
        "maxMsgSize": 65536,
        "msgRetentionSeconds": 86400,
        "rewindSeconds": 86400,
        "delayMsgNum": 0,
        "minMsgTime": 1564626851,
        "rewindMsgNum": 0,
        "inactiveMsgNum": 0,
        "activeMsgNum": 2,
        "lastModifyTime": 1563877026,
        "createTime": 1563877026,
        "queueName": "dns",
        "queueId": "queue-aiav4lys",
        "createUin": 100010439978,
        "Bps": 52428800,
        "qps": 5000,
        "tags": []
    }