Consumers take up to 90 seconds to process a message, but the queue's visibility timeout is 30 seconds — so messages get redelivered and processed multiple times. What's the fix?
A.Delete messages immediately on receipt
Deleting before processing loses messages on failure.
B.Increase the visibility timeout above the max processing time (or extend it with ChangeMessageVisibility)
Correct. Timeout > max processing time.
C.Reduce the message retention period
Retention is how long messages live in the queue — unrelated.
D.Switch to a FIFO queue
FIFO adds ordering/dedup — same visibility-timeout semantics.
Why this answer
Visibility timeout must exceed worst-case processing time — otherwise the message reappears while still being processed and another consumer picks it up. ChangeMessageVisibility lets long jobs extend the lock dynamically. FIFO doesn't fix processing-time vs timeout mismatch.
Correct answer: B · Last reviewed 2026-11-03
Official AWS references
Practice this interactively
Answer without seeing the solution first in the Serverless & APIs practice session.
Practice Serverless & APIs