I have a system design like this
SQS -> trigger -> Lambda -> if fails -> DLQ
pre condition
- Lambda function using a try catch block , it won't throw any errors .
- Lambda function never run out of memory , or timeout . (from Lambda monitoring)
- Error count is 0 in Lambda monitoring
- Never use SQS console to view messages
- Lambda SQS batchSize set to 1
- DLQ Maximum Receives set to 1
- Lambda invocation about 60k
After running for a while
- we found a few message in DLQ
- message in DLQ has attributes ApproximateReceiveCount is 2 or bigger.
Is this as expected ?
In my opinion if no error throws in Lambda , DLQ message should always be zero .