Menu
Amazon Simple Queue Service
Developer Guide

Tutorial: Deleting an Amazon SQS Queue

If you don't use an Amazon SQS queue (and don't foresee using it in the near future), it is a best practice to delete it from Amazon SQS. The following example demonstrates deleting a queue.

AWS Management Console

  1. Sign in to the AWS Management Console and open the Amazon SQS console at https://console.aws.amazon.com/sqs/.

  2. From the queue list, select a queue.

  3. From Queue Actions, select Delete Queue.

    The Delete Queues dialog box is displayed.

  4. Choose Yes, Delete Queue.

    The queue is deleted.

Java

Before you begin working with the example code, specify your AWS credentials. For more information, see Set up AWS Credentials and Region for Development in the AWS SDK for Java Developer Guide.

Note

This action is identical for standard and FIFO queues.

  1. Copy the standard queue example program or the FIFO queue example program.

    The following section of the code deletes the queue:

    Copy
    // Delete a queue System.out.println("Deleting the test queue.\n"); sqs.deleteQueue(new DeleteQueueRequest(myQueueUrl));
  2. Compile and run the example.

    The queue is deleted.