- Newest
- Most votes
- Most comments
You can't control the retry schedule from SQS, but you have a couple of options:
- Remove the message from the queue and put it back in, with a delay (note that you can set the delay for each message individually, no need to define a delay queue).
- Set the visibility timeout to some larger value and do not delete the message.
Hello.
Configure the Delay Attribute: By default, SQS queues have a delay of 0 seconds, meaning messages are available for processing as soon as they are sent to the queue. To introduce a delay, you'll need to set the DelaySeconds attribute when sending messages to the queue.
Using the AWS Management Console: When you send a message through the console, you can specify the delay in seconds as shown in the console UI.
Using the AWS CLI: You can use the --delay-seconds parameter when using the aws sqs send-message command. For example: aws sqs send-message --queue-url <queue-url> --message-body "Your message" --delay-seconds 300
Using an SDK: When using an SDK, you can set the DelaySeconds attribute in the message attributes or properties before sending the message.
But be careful that messages that have a delay set will not be visible to consumers until the specified delay period has passed. After the delay period, the messages become available for retrieval by consumers.
Best regards, Andrii
Relevant content
- asked 2 months ago
- asked 5 years ago
- AWS OFFICIALUpdated 8 months ago
- AWS OFFICIALUpdated 7 months ago
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated 8 months ago