Queries the information of a message queue. In addition to the configurations of the queue, this API operation returns the following queue information: the time when the queue was created, the time when the queue was last modified, and the approximate number of messages in the queue.

Request

A request consists of the following parts:

  • Request line

    GET /$queueName HTTP/1.1

  • Operation-specific request headers

    None. For information about common request parameters, see Common parameters.

  • Request Body

    None.

Response

A response consists of a status line, HTTP headers, and a response body.

  • HTTP Status Code

    HTTP/1.1 200OK

  • Operation-specific response headers

    None. For information about common response parameters, see Common parameters.

  • Response Body

    The response body is in the following XML format: <Queue>Queue parameter list</Queue>.

The following table lists the parameters in the response body.

Parameter Description
QueueName The name of the queue.
CreateTime The time when the queue was created. This value is a UNIX timestamp representing the number of seconds that have elapsed since the epoch time January 1, 1970, 00:00:00 UTC.
LastModifyTime The time when the queue was last modified. This value is a UNIX timestamp representing the number of seconds that have elapsed since the epoch time January 1, 1970, 00:00:00 UTC.
DelaySeconds The interval between the time when a message arrives at the queue and the time when the message becomes consumable. Unit: seconds.
MaximumMessageSize The maximum size of a message body. Unit: bytes.
MessageRetentionPeriod The maximum retention period of a message in the queue. After the period that is specified by this parameter expires, the message is deleted from the queue, regardless of whether the message has been consumed. Unit: seconds.
PollingWaitSeconds The maximum length of time for which a ReceiveMessage request waits for a message to arrive if no message exists in the queue. Unit: seconds.
ActiveMessages The approximate number of messages that are in the Active state in the queue.
InactiveMessages The approximate number of messages that are in the Inactive state in the queue.
DelayMessages The approximate number of messages that are in the Delayed state in the queue.

Special Error

Error code Error message HTTP status code
QueueNotExist The queue name you provided is not exist. 404
  • Sample requests
        GET /$queueName HTTP/1.1
        Host: $AccountId.mqs-cn-hangzhou.aliyuncs.com
        Date: Wed, 08 Mar 2012 12:00:00 GMT
        x-mqs-version: 2014-07-08
        Authorization: MQS 15B4D3461F177624206A:xQE0diMbLRepdf3YB+FIEXAMPLE=         
  • Sample success responses
        HTTP/1.1 200 OK
        Connection:close
        Content-Type=text/xml;charset=utf-8
        Content-Length:145
        x-mqs-request-id:512B2A634403E52B1956133E 
        x-mqs-version:2015-06-06
    
        <? xml version="1.0" encoding="UTF-8"? >
        <Queue xmlns=http://mqs.aliyuncs.com/doc/v1/">
        <QueueName>$queueName </QueueName ><!—returns the actual queue name->
        <CreateTime>1250700999</CreateTime >
        <LastModifyTime>1250700999</LastModifyTime>
        <VisibilityTimeout>60</VisibilityTimeout >
        <MaximumMessageSize>65536</MaximumMessageSize>
        <MessageRetentionPeriod>65536</MessageRetentionPeriod>
        <DelaySeconds>30</DelaySecond>
        <PollingWaitSeconds>0</PollingWaitSeconds>
        <InactiveMessages>0</InactiveMessages>
        <ActiveMessages>20</ActiveMessages>
        <DelayMessages >0</DelayMessages>
        </Queue>