A Lambda function processes batches from an Amazon SQS standard queue, but one invalid record causes successfully processed records to be retried. Which change avoids retrying successful records solely because another record failed?
Show the answer
Correct answerC. Enable partial batch responses and return failed message IDs.
AWhy not this: A short visibility timeout can expose messages while processing continues, increasing duplicate processing.
BWhy not this: SQS event source mappings invoke Lambda synchronously, so asynchronous invocation destinations do not handle these failures.
CWhy this is right: Partial batch responses let the event source mapping retry failed messages without retrying successful messages from that batch.
DWhy not this: Throwing an exception fails the entire batch; increasing its size can cause more successful records to be retried.
With ReportBatchItemFailures enabled, the function can report failed message IDs so only those messages are retried. Lambda asynchronous invocation destinations do not handle failures from an SQS event source mapping.