Course menuSAA-C03

Exams / SAA-C03 / Decoupling with queues / Question 6

SAA-C03 practice question: Decoupling with queues (6 of 6)

Design Resilient Architectures A free question from our original SAA-C03 practice exam. Try it, then open the answer to see why each option is right or wrong.

An Amazon EventBridge rule invokes an AWS Lambda function asynchronously for each new insurance claim. Occasionally the function fails on every attempt and the claim event is lost. The team must keep every failed event for investigation and replay. Investigators need the original event together with the full error the function returned, which often includes a stack trace of 3 to 5 KB. The team does not want to change the function code. What should a solutions architect do?

Choose one answer.

  1. A. Configure an Amazon SQS standard queue as the function's dead-letter queue, and read the failed events and error attributes from it.
  2. B. Configure an Amazon SQS standard queue as an on-failure destination for the function's asynchronous invocations.
  3. C. Set the function's maximum retry attempts to 2 and its maximum event age to 6 hours, so Lambda retries failed events for longer.
  4. D. Wrap the handler in a try/catch block that writes the event and stack trace to Amazon CloudWatch Logs before re-raising the error.
Show the answer and explanation

Answer: B

Explanation

Lambda discards an asynchronous event once retries are exhausted unless a dead-letter queue or an on-failure destination is configured. Both keep the event, but only the destination's invocation record includes the full function response; a dead-letter queue keeps just the event and the first 1 KB of the error message. An SQS on-failure destination therefore meets the replay and full-error needs with no code changes.

Study

Keep practising

Answer questions with a score at the end, or practise just this topic with the explanation after each one. No sign-up needed.