Medium1 markMultiple Choice
AWS SAP-C02 · Question 71 · Domain 2.4: Reliability
An architecture uses Amazon SQS and AWS Lambda. The Lambda function processes messages from the SQS queue and writes data to Amazon DynamoDB. Occasionally, the DynamoDB write fails due to a temporary network issue. How should the architect ensure the message is not lost and is retried?
An architecture uses Amazon SQS and AWS Lambda. The Lambda function processes messages from the SQS queue and writes data to Amazon DynamoDB. Occasionally, the DynamoDB write fails due to a temporary network issue. How should the architect ensure the message is not lost and is retried?
Answer options:
A.
Write custom code in the Lambda function to push the message back to the SQS queue.
B.
Do nothing. If the Lambda function throws an error, the message becomes visible in the SQS queue again after the visibility timeout expires.
C.
Configure a Dead Letter Queue on the Lambda function.
D.
Use AWS Step Functions to orchestrate the retry logic.
How to approach this question
Understand the native SQS-Lambda integration behavior.
Full Answer
B.Do nothing. If the Lambda function throws an error, the message becomes visible in the SQS queue again after the visibility timeout expires.✓ Correct
Do nothing. If the Lambda function throws an error, the message becomes visible in the SQS queue again after the visibility timeout expires.
When Lambda reads a message from SQS, it remains in the queue but is hidden by the visibility timeout. If the Lambda function executes successfully, it deletes the message. If it fails (throws an error), the timeout expires, and the message becomes visible again for another worker to process.
Common mistakes
Writing custom retry logic when the service handles it natively.
Practice the full AWS Solutions Architect Professional SAP-C02 Practice Exam 7
75 questions · hints · full answers · grading
More questions from this exam
Q01A global enterprise is designing a multi-region network architecture connecting 50 AWS accounts a...HardQ02A company is migrating its hybrid network to AWS. They have two 10 Gbps AWS Direct Connect connec...HardQ03An enterprise has 100 AWS accounts in AWS Organizations. The security team mandates that all Amaz...MediumQ04A financial company requires that all EBS volumes, S3 buckets, and RDS databases be encrypted usi...EasyQ05An enterprise is designing a disaster recovery strategy for a critical application running on Ama...Hard
Expert