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. It allows you to send, store, and receive messages between software components at any volume, without losing messages or requiring other services to be available.
When working with AWS SQS, you might encounter the error code AWS.SimpleQueueService.InvalidMessageRetentionPeriod
. This error typically occurs when you attempt to set a message retention period that is outside the allowed range.
When this error occurs, you will see a message indicating that the message retention period is invalid. This can happen during the creation of a new queue or when updating the settings of an existing queue.
The AWS.SimpleQueueService.InvalidMessageRetentionPeriod
error is triggered when the specified message retention period does not fall within the acceptable range. AWS SQS requires that the message retention period be set between 60 seconds (1 minute) and 1209600 seconds (14 days).
This error is often due to a misconfiguration or a typo in the settings where the retention period is specified. It is crucial to ensure that the value is within the permissible limits to avoid this error.
To resolve the AWS.SimpleQueueService.InvalidMessageRetentionPeriod
error, follow these steps:
Check the current configuration of your SQS queue to ensure that the message retention period is set correctly. You can do this via the AWS Management Console or by using the AWS CLI.
aws sqs get-queue-attributes --queue-url --attribute-names MessageRetentionPeriod
Replace <your-queue-url>
with the actual URL of your SQS queue.
If the retention period is incorrect, update it to a valid value. Use the AWS CLI to set a new retention period:
aws sqs set-queue-attributes --queue-url --attributes MessageRetentionPeriod=
Ensure that <valid-period-in-seconds>
is between 60 and 1209600 seconds.
After updating, confirm that the changes have been applied successfully by retrieving the queue attributes again:
aws sqs get-queue-attributes --queue-url --attribute-names MessageRetentionPeriod
This should reflect the new, valid retention period.
For more information on configuring AWS SQS, refer to the official AWS SQS Developer Guide. You can also explore the AWS SQS FAQs for common questions and answers.
Let Dr. Droid create custom investigation plans for your infrastructure.
Book Demo