DeleteQueue

Deletes the queue specified by the queue URL. Normally, a queue must be empty before you can delete it. However, you can set the request parameter ForceDeletion to true to force the deletion of a queue even if it's not empty.

[Caution]Caution

Use the ForceDeletion parameter with care; once you delete your messages in a queue, they are no longer available.

Once you delete a queue, you must wait at least 60 seconds before creating a queue with the same name.

The following table lists the special request parameters the action uses (in addition to the common request parameters listed in Common Request Parameters).

NameDescriptionRequired

ForceDeletion

When set to true, the queue is deleted even if it is not empty. If this parameter is omitted or set to false, the queue must be empty for the DeleteQueue action to succeed. Use this parameter with care, because once you delete your messages, you cannot access them again.

Type: Boolean

Default: false

Valid values: false | true

No

The response contains no special elements besides the common elements listed in The Structure of a Response.

The following table lists the special errors the action returns (in addition to the common errors listed in Common Errors).

ErrorDescriptionHTTP Status Code

AWS.SimpleQueueService.NonEmptyQueue

Queue not empty.

400

The following example Query request deletes the specified queue even if it's not empty.