The GetQueueAttributes action gets one or all attributes of a queue. Queues
currently have two attributes you can get:
ApproximateNumberOfMessages (for more information, see Resources Required to Process Messages)
VisibilityTimeout (for more information, see Visibility Timeout)
![]() | Important |
|---|---|
Before the 2007-05-01 release introduced the |
The following table lists the special request parameters the
GetQueueAttributes action uses in addition to the common request parameters
all actions use (for more information, see Request Parameters Common to All Actions).
| Name | Description | Required |
|---|---|---|
|
|
The attribute you want to get. Setting this value to Type: String Valid values: |
Yes |
The following table lists the response elements the GetQueueAttributes
action returns in addition to the common response elements all actions return (for more
information, see Structure of a Successful Response).
| Name | Description |
|---|---|
|
|
An element containing each attribute's information. Ancestor: Children:
|
The following table lists the special errors the GetQueueAttributes action
returns in addition to the common errors all actions return (for more information, see Errors Common to all Actions).
| Error | Description | HTTP Status Code |
|---|---|---|
|
|
Unknown attribute |
400 |
The following example Query request gets all the attribute values for the specified queue.
http://queue.amazonaws.com/queue2 ?Action=GetQueueAttributes &AttributeName=All &AWSAccessKeyId=0GS7553JW74RRM612K02EXAMPLE &Version=2008-01-01 &Expires=2008-02-10T12:00:00Z &Signature=Dqlp3Sd6ljTUA9Uf6SGtEExwUQEXAMPLE &SignatureVersion=2 &SignatureMethod=HmacSHA256
<GetQueueAttributesResponse>
<GetQueueAttributesResult>
<Attribute>
<Name>ApproximateNumberOfMessages</Name>
<Value>2900</Value>
</Attribute>
<Attribute>
<Name>VisibilityTimeout</Name>
<Value>35</Value>
</Attribute>
</GetQueueAttributesResult>
<ResponseMetadata>
<RequestId>cb919c0a-9bce-4afe-9b48-9bdf2412bb67</RequestId>
</ResponseMetadata>
</GetQueueAttributesResponse>