AWS Certified Developer – Associate (DVA-C02) — Question 268
A developer is building an application on AWS. The application includes an AWS Lambda function that processes messages from an Amazon Simple Queue Service (Amazon SQS) queue.
The Lambda function sometimes fails or times out. The developer needs to figure out why the Lambda function fails to process some messages.
Which solution will meet these requirements with the LEAST operational overhead?
Answer options
- A. Increase the maximum timeout of the Lambda function to 15 minutes. Check the AWS CloudTrail event history for error details.
- B. Increase the visibility timeout of the SQS queue. Check logs in Amazon CloudWatch Logs for error details.
- C. Create a dead-letter queue. Configure the Lambda function to send the failed messages to the dead-letter queue.
- D. Create an Amazon DynamoDB table. Update the Lambda function to send the failed messages to the DynamoDB table.
Correct answer: C
Explanation
Configuring a dead-letter queue (DLQ) is the native AWS solution to isolate messages that cannot be processed successfully, requiring minimal configuration and zero custom code. Options A and B do not help isolate the specific failing messages for debugging and do not address the root cause of message processing failures. Option D introduces unnecessary operational overhead because it requires writing and maintaining custom code within the Lambda function to handle failures and write to Amazon DynamoDB.