AWS Certified DevOps Engineer – Professional (DOP-C02) — Question 183
A DevOps engineer is building a solution that uses Amazon Simple Queue Service (Amazon SQS) standard queues. The solution also includes an AWS Lambda function and an Amazon DynamoDB table. The Lambda function pulls content from an SQS queue event source and writes the content to the DynamoDB table.
The solution must maximize the scalability of Lambda and must prevent successfully processed SQS messages from being processed multiple times.
Which solution will meet these requirements?
Answer options
- A. Decrease the batch window to 1 second when configuring the Lambda function's event source mapping.
- B. Decrease the batch size to 1 when configuring the Lambda function's event source mapping.
- C. Include the ReportBatchItemFailures value in the FunctionResponseTypes list in the Lambda function's event source mapping.
- D. Set the queue visibility timeout on the Lambda function's event source mapping to account for invocation throttling of the Lambda function.
Correct answer: C
Explanation
The correct answer is C because including the ReportBatchItemFailures value allows the Lambda function to report which items failed to process, ensuring that successfully processed messages are not retried. Option A does not address message processing and could lead to throttling. Option B also does not prevent processing duplicates. Option D focuses on visibility timeout but does not directly prevent the reprocessing of successfully handled messages.