Practice free →
HomeAWS Developer Associatecloudcomputingawsdevelopment › A Lambda function is processing messages from an…

A Lambda function is processing messages from an SQS queue. Some messages fail repeatedly. Which is the recommended pattern to keep the queue moving and quarantine the bad messages?

ALoop the failing message back to the front of the queue indefinitely
BDelete every message that fails once, regardless of cause
CSwitch the queue to Amazon S3 Glacier Deep Archive for safekeeping
DConfigure a Dead-Letter Queue (DLQ) on the SQS source so messages exceeding maxReceiveCount land there for inspection
Answer & Solution
Correct answer: D. Configure a Dead-Letter Queue (DLQ) on the SQS source so messages exceeding maxReceiveCount land there for inspection
DLQs are the canonical pattern: failed messages exceeding maxReceiveCount move out of the main queue so consumers stop getting blocked, and operators can investigate. The other options drop data, livelock, or aren't queues.
Solve this in the app — AWS Developer Associate practice & 24k+ MCQs →
Related questions