I actually thought you were going to say ApproximateReceiveCount
when I asked how you’d keep track of retries.
Normally, the inaccuracy of ApproximateReceiveCount
is that it may be lower than the actual receive count. The Lambda-SQS issue, however, disconnects the number of receives from the number of times your function has handled the message.
If you write code to give up after 3 retries, you could theoretically handle a message that has an ApproximateReceiveCount
of 3
the first time you handle it due to Lambda having received it in the past but not been able to invoke your function.
If giving up means you send the message to another queue and return successfully (to remove the message from the original queue), you basically end up in the same place as before because you’ve just manually implemented SQS’ DLQs.