A company is using AWS Lambda functions to process data from an SQS queue. The Lambda function sometimes fails due to transient errors, but the messages are not being retried. Which configuration should the company check to ensure proper retry behavior?
This setting directly controls how many times Lambda retries failed messages from SQS.
Why this answer
The correct setting is the 'Maximum retries' in the Lambda event source mapping for SQS. This parameter controls how many times Lambda will retry a failed message batch (default is 3). Option A is incorrect because the dead-letter queue (DLQ) is used to store messages that have failed after all retries are exhausted, not to control the number of retries.
Option C is incorrect because the SQS queue's redrive policy 'maxReceiveCount' is used for SQS redrive to a DLQ, not for Lambda retries. Option D is incorrect because the SQS queue's Default visibility timeout determines how long a message is hidden after being received, but does not affect the retry count for Lambda processing.