AWS Certified Developer – Associate — Question 202

A company has an AWS Lambda function that reads messages from an Amazon Simple Queue Service (Amazon SQS) queue by using the Amazon SQS API. The Lambda function is not processing all the messages successfully because of random failures of a third-party dependency. A developer needs to improve the reliability of the Lambda function so that the Lambda function will process each message successfully despite the failures of the third-party dependency.

Which solution will meet this requirement with the LEAST effort?

Answer options

Correct answer: D

Explanation

Option D is correct because it allows for capturing failures in a structured manner by utilizing a dead-letter queue, which helps in isolating problematic messages without losing them. Option A does not provide a mechanism for tracking failures effectively, and simply retrying without a dead-letter approach could lead to message loss. Option B changes the message retrieval method but does not directly address the handling of failures from the third-party dependency. Option C, while it introduces a dead-letter queue, lacks the exception handling aspect that is crucial for managing dependency failures effectively.