Amazon Simple Queue Service (SQS) is a fully managed message queuing service that enables you to decouple and scale microservices, distributed systems, and serverless applications. SQS eliminates the complexity and overhead associated with managing and operating message-oriented middleware, and empowers developers to focus on differentiating work.
When working with AWS SQS, you might encounter the error code AWS.SimpleQueueService.QueueDeletedRecently
. This error typically occurs when you attempt to recreate a queue that was recently deleted.
Upon attempting to create a new queue with the same name as a recently deleted one, the operation fails, and you receive the error message: AWS.SimpleQueueService.QueueDeletedRecently
.
The AWS.SimpleQueueService.QueueDeletedRecently
error indicates that AWS SQS has a restriction on immediately recreating a queue with the same name after it has been deleted. This is a protective measure to ensure data consistency and to prevent accidental data loss.
When a queue is deleted, AWS SQS retains the queue's metadata for a short period to prevent accidental recreation that might lead to data inconsistency or loss. This retention period is typically around 60 seconds.
To resolve the AWS.SimpleQueueService.QueueDeletedRecently
error, follow these steps:
After deleting a queue, wait for at least 60 seconds before attempting to recreate it. This waiting period allows AWS SQS to clear the metadata of the deleted queue.
Ensure that the queue has been successfully deleted. You can verify this by listing all queues and checking that the queue name no longer appears in the list. Use the following AWS CLI command:
aws sqs list-queues
Once the retention period has passed, attempt to recreate the queue using the AWS Management Console, AWS CLI, or SDKs. For example, using the AWS CLI, you can run:
aws sqs create-queue --queue-name MyQueue
For more information on AWS SQS and managing queues, refer to the following resources:
Let Dr. Droid create custom investigation plans for your infrastructure.
Book Demo