2 Answers
- Newest
- Most votes
- Most comments
2
Hello.
How about setting up a delay queue on the SQS side?
By setting this, you will be able to wait up to 15 minutes before processing a message.
https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-delay-queues.html
0
I have a lambda function that sends some data to sqs queue in form of messages like 10-15 messages at a time. Now what I want is when these messages arrive in queue I need a 30 sec delay after which these messages are sent to lambda function trigger . Setting delivery delay doesn't work for me because it delays all the messages for that particular time and after that it sends all at once
answered 7 months ago
Relevant content
- Accepted Answerasked 4 years ago
- Accepted Answerasked 3 years ago
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated 5 months ago
- AWS OFFICIALUpdated 2 years ago
I have a lambda function that sends some data to sqs queue in form of messages like 10-15 messages at a time. Now what I want is when these messages arrive in queue I need a 30 sec delay after which these messages are sent to lambda function trigger . Setting delivery delay doesn't work for me because it delays all the messages for that particular time and after that it sends all at once
In that case, I thought it would be a good idea to set a message timer. This means setting a delivery delay for each message. https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-message-timers.html
So, I thought it would be a good idea to set "DelaySeconds" with a random number from 0 seconds to 900 seconds when sending a message in Lambda that sends the message. https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/sqs/client/send_message.html