DeleteQueue
Deletes the queue specified by the QueueUrl
, regardless of the queue's
contents.
Important
Be careful with the DeleteQueue
action: When you delete a queue, any
messages in the queue are no longer available.
When you delete a queue, the deletion process takes up to 60 seconds. Requests you
send involving that queue during the 60 seconds might succeed. For example, a
SendMessage
request might succeed, but after 60
seconds the queue and the message you sent no longer exist.
When you delete a queue, you must wait at least 60 seconds before creating a queue with the same name.
Note
Cross-account permissions don't apply to this action. For more information, see Grant cross-account permissions to a role and a username in the Amazon SQS Developer Guide.
The delete operation uses the HTTP GET
verb.
Request Syntax
{
"QueueUrl": "string
"
}
Request Parameters
For information about the parameters that are common to all actions, see Common Parameters.
The request accepts the following data in JSON format.
- QueueUrl
-
The URL of the Amazon SQS queue to delete.
Queue URLs and names are case-sensitive.
Type: String
Required: Yes
Response Elements
If the action is successful, the service sends back an HTTP 200 response with an empty HTTP body.
Errors
For information about the errors that are common to all actions, see Common Errors.
Examples
The following example query request deletes the specified queue.
The structure of AUTHPARAMS
depends on the signature of the API request.
For more information, see
Examples of Signed Signature Version 4 Requests in the
Amazon General Reference.
Example
Using Amazon query protocol
Sample Request
POST /177715257436/MyQueue/ HTTP/1.1
Host: sqs.us-east-1.amazonaws.com
Content-Type: application/x-www-form-urlencoded
X-Amz-Date: <Date>
Authorization: <AuthParams>
Content-Length: <PayloadSizeBytes>
Connection: Keep-Alive
Action=DeleteQueue
Sample Response
HTTP/1.1 200 OK
<?xml version="1.0"?>
<DeleteQueueResponse xmlns="http://queue.amazonaws.com/doc/2012-11-05/">
<ResponseMetadata>
<RequestId>22b441f1-c3c3-54e4-9f57-1d817c509a21</RequestId>
</ResponseMetadata>
</DeleteQueueResponse>
See Also
For more information about using this API in one of the language-specific Amazon SDKs, see the following: