Medium1 markMultiple Choice
Domain 2.4: ReliabilityReliabilitySQSLambda

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?

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