Course menuSAA-C03

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

SAA-C03 practice question: Decoupling with queues (4 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.

A media company uses Amazon EC2 workers to transcode video clips from an Amazon SQS standard queue. Each clip takes between 2 and 4 minutes to process, after which the worker deletes the message. The queue still uses its default settings. The operations team notices that many clips are transcoded two or three times, which wastes compute, even though no worker has crashed. Which change will MOST effectively stop the repeated processing?

Choose one answer.

  1. A. Turn on long polling by setting the queue's receive message wait time to 20 seconds, so workers make fewer empty receive calls.
  2. B. Set a delivery delay of 5 minutes on the queue, so that each new message stays hidden for longer before workers can receive it.
  3. C. Add a dead-letter queue with a maximum receive count of 1, so that any message received a second time is moved aside.
  4. D. Raise the queue's visibility timeout to about 6 minutes, so that a message stays hidden until its clip is finished.
Show the answer and explanation

Answer: D

Explanation

When a worker receives an SQS message, it is hidden only for the visibility timeout, which defaults to 30 seconds. Because each clip takes 2 to 4 minutes, messages reappear and are processed again. Setting the timeout longer than the maximum processing time (or extending it per message with ChangeMessageVisibility) stops the duplicates. Long polling and delivery delays do not affect in-flight messages.

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.