A video processing pipeline uses EC2 instances in an Auto Scaling group to process videos from an SQS queue. Each video takes about 30 minutes to process. The SQS queue has a redrive policy to a dead-letter queue with maxReceiveCount set to 1. The queue visibility timeout is 1 hour. CloudWatch alarms notify the team when messages arrive in the dead-letter queue. Several times per day, messages show up in the DLQ and videos have not been processed. Application logs show no errors. What change will prevent this problem?
Choose an answer
Tap an option to check your answer.
Correct answer: Enable scale-in protection for instances while they are processing videos..
Why this is the answer
The problem describes messages appearing in the dead-letter queue (DLQ) despite no application errors, indicating that instances are being terminated mid-processing. Each video takes 30 minutes to process, and the SQS visibility timeout is 1 hour, which is sufficient for a single processing attempt. However, if an EC2 instance is terminated by Auto Scaling while processing a video, the message will eventually become visible again in the main queue. With maxReceiveCount set to 1, a second attempt will immediately send the message to the DLQ if the first attempt was interrupted. Enabling scale-in protection for instances while they are processing videos prevents Auto Scaling from terminating them prematurely, ensuring the processing completes. Increasing the visibility timeout to 3 hours is unnecessary and could delay reprocessing of genuinely failed messages. Enabling termination protection on EC2 instances is a manual setting and not practical for Auto Scaling groups. Setting maxReceiveCount to 0 would prevent any messages from being processed, as they would immediately go to the DLQ.
Pass your exam — without the endless answer hunt
Get every verified question and explanation for this exam in one place, and save hours of prep. 1,000+ certifications · 20+ languages · free to start.
Pass your exam faster → No card needed