SQS messages reappear in queue even after successful execution by lambda.

0

Hi, we have a lambda with SQS as a trigger. we have been seeing spikes (more frequently in the past few weeks) in Oldest message age in SQS so when looked into it we found that SQS messages are reappearing in queue even after successful execution by lambda. but the second time same message with equal message ID reappears and is again successful and now its getting deleted in the queue. this is happening transiently and every time this happens we get a spike in Oldest message age metric. So is it the case that lambda is unable to delete the message in the queue even after successful return? or Is it due to any other reason? Configuration: Lambda timeout : 15min sqs visibility timeout : 15 min Batch size: 1

AWS
已提問 1 年前檢視次數 883 次
2 個答案
0

Please check the following recommendations in the AWS SQS documentation on how to best configure the SQS Queue. https://docs.aws.amazon.com/lambda/latest/dg/with-sqs.html#events-sqs-queueconfig

AWS
專家
已回答 1 年前
0

Problems like this are usually because the message isn't really being deleted by your Lambda. Have you made sure your exception handling on AWS API calls is solid, and do you have logging for any situations where your message processing or deletion could fail? Depending on traffic you could for example be hitting AWS API request throtting occasionally so make sure your SDK, or you, have retries in place with exponential backoff.

專家
已回答 1 年前

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

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

回答問題指南