A Lambda consumer processes an SQS FIFO batch sequentially with partial batch responses enabled, and processing fails midway through the batch. To preserve ordering and avoid retrying completed messages, how should the consumer handle the remaining batch?
Show the answer
Correct answerB. Stop processing and report failed and unprocessed messages.
AWhy not this: Reporting success removes failed work from the queue instead of allowing it to be retried.
BWhy this is right: Stopping and reporting failed and unprocessed messages preserves ordering without retrying completed messages.
CWhy not this: Reporting completed messages as failures causes unnecessary retries and can repeat their side effects.
DWhy not this: Continuing after a failure can process later messages before the failed message succeeds, violating ordering.
For FIFO partial batch handling, stop after the first failure and return the failed and unprocessed message identifiers. Reporting the entire batch would unnecessarily retry messages that already completed successfully.