The SetQueueAttributes action sets an attribute of a queue. Currently, you
can set only the VisibilityTimeout attribute for a queue. For more
information about this attribute, see Visibility Timeout. When you
change a queue's attributes, the change can take up to 60 seconds to propagate throughout the SQS
system.
![]() | Important |
|---|---|
Before the 2007-05-01 release introduced the |
The following table lists the special request parameters the
SetQueueAttributes 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 name of the attribute you want to set. Type: String Valid Value: |
Yes |
|
|
The value of the attribute you want to set. Type: For visibility timeout, the value must be an integer from 0 to 7200, inclusive (maximum 2 hours). |
Yes |
The response contains no special elements besides the common elements in all successful responses (for more information, see Structure of a Successful Response).
The following table lists the special errors the SetQueueAttributes 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 sets the visibility timeout to 35 seconds for the specified queue (queue2).
http://queue.amazonaws.com/queue2 ?Action=SetQueueAttributes &Attribute.Name=VisibilityTimeout &Attribute.Value=35 &AWSAccessKeyId=0GS7553JW74RRM612K02EXAMPLE &Version=2008-01-01 &Expires=2008-02-10T12:00:00Z &Signature=Dqlp3Sd6ljTUA9Uf6SGtEExwUQEXAMPLE &SignatureVersion=2 &SignatureMethod=HmacSHA256
<SetQueueAttributesResponse>
<ResponseMetadata>
<RequestId>cb919c0a-9bce-4afe-9b48-9bdf2412bb67</RequestId>
</ResponseMetadata>
</SetQueueAttributesResponse>