A Lambda function processes Amazon SQS messages in batches, but one failed message causes successfully processed messages to be retried. What should an engineer implement to retry only the failed messages?
Show the answer
Correct answerA. Enable partial batch responses and return failed message identifiers.
AWhy this is right: Partial batch responses identify failed messages so successfully processed messages do not need to be retried.
BWhy not this: Asynchronous invocation destinations do not handle failures from an SQS event source mapping.
CWhy not this: Returning success acknowledges the batch; a dead-letter queue does not independently identify failed messages.
DWhy not this: Raising a batch exception fails the entire batch, and a shorter visibility timeout does not isolate failed messages.
With ReportBatchItemFailures enabled, Lambda can retry only the messages identified as failed in the function response. A dead-letter queue handles messages after repeated unsuccessful receives; it does not identify individual failures within a successful batch response.