How to stop a Lambda function from retrying itself forever?


Hey guys, I've been working with SQS-Lambda connection and faced the problem that when something is going wrong with the Lambda function it starts to retry the Lambda code hundreds of times till I changed the corcurrency limit to 0. What is the best way to set a Lambda function to run just once, and if an error occurs doesn't retry to execute itself?

Many thanks!

asked 3 months ago140 views
1 Answer
Accepted Answer


How about setting up an SQS dead letter queue so that once an error occurs, it sends to the dead letter queue?

I thought that setting the number of times to move to the dead letter queue (maxReceiveCount) to a low number such as 1 would prevent infinite retries.

profile picture
answered 3 months 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