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 using AWS SQS, you might encounter the error code AWS.SimpleQueueService.InvalidDelaySeconds
. This error typically occurs when you attempt to set a delay for a message that is outside the permissible range.
Upon attempting to send a message with a delay, the operation fails, and you receive an error message indicating an invalid delay seconds value.
The error code AWS.SimpleQueueService.InvalidDelaySeconds
indicates that the delay seconds value specified is not within the allowed range. AWS SQS allows you to set a delay of up to 900 seconds (15 minutes) for a message. This feature is useful for postponing the delivery of messages to the queue.
This error occurs when the delay seconds value is set to a number less than 0 or greater than 900. The delay seconds parameter must be an integer within this range.
To resolve this issue, ensure that the delay seconds value is correctly set within the valid range.
Here is an example of setting a valid delay seconds value using the AWS SDK for Python (Boto3):
import boto3
sqs = boto3.client('sqs')
response = sqs.send_message(
QueueUrl='https://sqs.us-east-1.amazonaws.com/123456789012/MyQueue',
MessageBody='Hello, world!',
DelaySeconds=300 # Valid delay seconds
)
print(response)
For more information on AWS SQS and its features, refer to the following resources:
Let Dr. Droid create custom investigation plans for your infrastructure.
Book Demo