Trigger Lambda from SQS with delay after each trigger

0

I have a use case to trigger a lambda function from SQS queue and get data from cloudtrail lookup events api . But the api is giving Rate exceeded error because the SQS is triggering the lambda function continously without any delay so there is no delay in subsequent api requests . How can i control the trigger of lambda function with delays so that there is a gap in subsequent api requests .

2 個答案
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

profile picture
專家
已回答 3 個月前
profile picture
專家
已審閱 2 個月前
profile picture
專家
已審閱 3 個月前
profile pictureAWS
專家
已審閱 3 個月前
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

已回答 3 個月前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南