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

2 Answers
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
EXPERT
answered a year ago
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.

EXPERT
answered a year ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions