
The specific retry behavior for processing SQS messages is determined in the SQS queue configuration. Here you can set the visibility timeout, message retention period, and delivery delay.

If a Lambda function throws an error, the Lambda service continues to process the failed message until:
Lambda does not delete messages from the queue unless there is a successful invocation. By default, if any messages in a batch fail, all messages are returned to the original queue for reprocessing. This may include messages that Lambda has processed successfully. Specify individual message failures using batchItemFailures in the function response. Only the failed items are then reprocessed.
In an application under heavy load or with spiky traffic patterns, it’s recommended that you:
Note that an SQS DLQ is different to a Lambda DLQ, which is used for the function’s asynchronous invocation queue, not for event source queues.