Q71 — AWS DOP-C02 Ch.2

Question 71 of 100 | ← Chapter 2

A company launches a new application in a new AWS account. The application includes an AWS Lambda function that processes messages from an Amazon Simple Queue Service (SQS) standard queue. The Lambda function stores results in an Amazon S3 bucket for further downstream processing. The Lambda function must process messages within one second after they are published. The Lambda function’s batch size is configured for 10 messages, and processing one message takes 0.5 seconds. As application load increases on the first day of service, messages accumulate in the queue faster than the Lambda function can process them. Some messages miss their required processing deadline. Logs indicate many messages in the queue contain invalid data. The company must meet the processing deadline requirement for messages containing valid data. Which solution meets these requirements?

Correct Answer: D. Keep the Lambda function’s batch size unchanged. Configure the Lambda function to report batch item failures. Configure a dead-letter queue.

Explanation

When integrating AWS Lambda with Amazon SQS, if message processing throughput is insufficient and invalid data is present, ensuring timely processing of valid messages is critical. Lambda’s event source mapping supports reporting partial failures, allowing the function to skip invalid messages and avoid reprocessing entire batches. Invalid messages can be routed to a dead-letter queue (DLQ), preventing them from blocking valid messages. AWS documentation states that configuring `ReportBatchItemFailures` reduces redundant retries caused by partial failures, improving throughput efficiency. Option D directly addresses the invalid data accumulation issue by retaining batch size and introducing a DLQ, whereas other options either ignore invalid messages or adjust batch size in ways that compromise timeliness.