Home › AWS Developer Associate › cloudcomputing › awsdevelopment › 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.
Related questions
A Lambda function reads from a Kinesis Data Stream. Throughput is fine on average but spikAn API Gateway REST API in front of Lambda needs to authenticate requests using a Cognito Which strategy allows a Lambda function inside a VPC to access the internet (e.g., to callA serverless app needs to fan out a single event to multiple downstream Lambda functions, A Lambda function processes a large file from S3. Cold starts are unacceptably long on JavWhich AWS feature lets developers attach short-lived AWS credentials to a Lambda function What does it mean for an API endpoint to be IDEMPOTENT?Which Lambda configuration setting most directly affects the function's CPU and network pe