A developer is implementing a background worker service on Amazon ECS to process batch image transcoding jobs from an Amazon SQS standard queue. The average transcoding job takes 4 minutes to complete, but high-resolution images can take up to 12 minutes. During testing, the developer observes that multiple ECS tasks are frequently processing the same image file concurrently, resulting in duplicate outputs and wasted compute resources. Additionally, corrupt image files that fail to transcode are retried indefinitely, blocking the queue.
Which combination of configuration steps should the developer perform to resolve these issues? (Select TWO.)
- Set the SQS queue's visibility timeout to a value greater than 12 minutes to allow sufficient time for transcoding to complete before the message is made available to other tasks.Cevap
- Configure a dead-letter queue (DLQ) and specify a redrive policy on the source SQS queue with a maxReceiveCount value to capture and isolate consistently failing messages.Cevap
- CDecrease the visibility timeout of the SQS queue to 1 minute to ensure that if a task fails, another ECS task can immediately pick up the message.
- DIncrease the task execution timeout of the ECS tasks to 15 minutes without modifying the SQS queue parameters.
- EHardcode an IAM user access key and secret key inside the worker application code when constructing the AWS SDK client to reduce the latency of credentials retrieval.
Cevap
Configure the SQS queue's visibility timeout to a value greater than 12 minutes, and set up a dead-letter queue (DLQ) with a redrive policy and maxReceiveCount on the main SQS queue to isolate failing messages.
To prevent duplicate processing of messages, the SQS visibility timeout must be configured to be longer than the maximum time it takes for a consumer to process a message. This ensures the message remains hidden from other consumers while the active worker completes its task. To handle corrupt or unprocessable messages that would otherwise block the queue indefinitely, a dead-letter queue (DLQ) must be configured with a redrive policy using a maxReceiveCount parameter to isolate these messages after a set number of failures.
Adım Adım Çözüm
Anahtar Kavram
SQS visibility timeout configuration and dead-letter queue (DLQ) handling