Interview Prep/AWS/Route 53, CloudFront and Messaging

Lambda reading SQS processes the same failed batch repeatedly. How to fix partial failures?

IntermediateScenarioRoute 53, CloudFront and Messaging
Answer

Situation read → Without partial batch response, one bad record retries the whole batch.

What I'd do →

  1. Enable ReportBatchItemFailures on the event source mapping
  2. Return {"batchItemFailures":[{"itemIdentifier":"<messageId>"}]}
  3. Set a DLQ on the queue
  4. Set visibility timeout at least 6 times function timeout
  5. Reduce batch size if poison messages are common

Why → Only failed records return to the queue.

Interview tip → AWS recommends 6x function timeout for visibility.

aws All AWS questions Roadmap: AWS core services

More on Route 53, CloudFront and Messaging