DELETE on MessageQueue

The Delete on MessageQueue action 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 a queue's deletion 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 headers listed in Common REST Headers).

NameDescriptionRequired

ForceDeletion

When set to true, the queue is deleted even if it's 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 response elements.

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 REST request deletes the specified queue even if it's empty.

[Important]Important

When specifying a queue when using the REST API, make sure to omit http://queue.amazon.aws.com from the queue URL and provide only what's left (/A29E9WXPHGOG29/queue1 in the following example).

See DeleteQueue for sample response information.