All Products
Search
Document Center

GetQueueAttributes

Last Updated: Jul 23, 2019

Description

This interface is used to acquire the attributes of a created queue. Along with the attributes which are configured in the queue creation, the creation time of the queue, the last modification time of queue attributes, and the counts of various types of messages in the queue (approximate values) are returned.

Request

A request mainly includes the following parts.

  • Request line

    GET /queues/$queueName HTTP/1.1

  • Special Request Header

    None. See “Public Request Headers”.

  • Request Body

    None.

Response

The returned message includes 3 parts: returned status line, HTTP header, and message body.

  • HTTP Status Code

    HTTP/1.1 200OK

  • Special Response Header

    None. See “Public Return Headers”.

  • Response Body

    The return result is in XML format. The format is:<Queue>Attribute Element List</Queue>

The attribute element list includes:

Parameter Name Description
QueueName Queue name
CreateTime Creation time of the queue. It is seconds that have elapsed since 1970-1-1 0:00 till now
LastModifyTime Last modification time of the queue attributes. It is seconds that elapse since 1970-1-1 0:00 till now
DelaySeconds A delay time after which the message sent to the queue can be consumed, measured in seconds
MaximumMessageSize Maximum body length of a message sent to the queue, measured in bytes
MessageRetentionPeriod Maximum lifetime of the message in the queue, measured in seconds. After the time specified by this parameter expires, the message will be deleted no matter whether it has been consumed or not
PollingWaitSeconds It is the maximum time that a ReceiveMessage request could be waiting for any incoming messages, while there are no message in the queue. Measured in seconds.
Activemessages Total number of active messages in the queue, which is an approximate value
InactiveMessages Total number of inactive messages in the queue, which is an approximate value
DelayMessages Total number of delayed messages in the queue, which is an approximate value

Special Error

Error Code Error Message Status Code
QueueNotExist The queue name you provided is not exist. 404

Request example:

  1. GET /queues/$queueName HTTP/1.1
  2. Host: $AccountId.mns.cn-hangzhou.aliyuncs.com
  3. Date: Wed, 08 Mar 2012 12:00:00 GMT
  4. x-mns-version: 2015-06-06
  5. Authorization: MNS 15B4D3461F177624206A:xQE0diMbLRepdf3YB+FIEXAMPLE=

Return example:

  1. HTTP/1.1 200 OK
  2. Connection:close
  3. Content-Type=text/xml;charset=utf-8
  4. Content-Length:145
  5. x-mns-request-id:512B2A634403E52B1956133E
  6. x-mns-version: 2015-06-06
  7. <?xml version="1.0" encoding="UTF-8"?>
  8. <Queue xmlns=http://mns.aliyuncs.com/doc/v1/”>
  9. <QueueName>$queueName </QueueName ><!—The actual Queue Name is returned ->
  10. <CreateTime>1250700999</CreateTime >
  11. <LastModifyTime>1250700999</LastModifyTime>
  12. <VisibilityTimeout>60</VisibilityTimeout >
  13. <MaximumMessageSize>65536</MaximumMessageSize>
  14. <MessageRetentionPeriod>65536</MessageRetentionPeriod>
  15. <DelaySeconds>30</DelaySecond>
  16. <PollingWaitSeconds>0</PollingWaitSeconds>
  17. <InactiveMessages>0</InactiveMessages>
  18. <ActiveMessages>20</ActiveMessages>
  19. < DelayMessages >0</ DelayMessages>
  20. </Queue>