A developer is designing a document processing system. User-uploaded documents are published to an Amazon SNS topic. Two Amazon SQS queues are subscribed to the topic: Queue A feeds a text-extraction service running on Amazon ECS, which takes up to 45 seconds to process each document, while Queue B feeds an archiving service. During high-load periods, the text-extraction service experiences two problems: many documents are processed multiple times by different ECS tasks, and SQS messages sent to Queue A are occasionally discarded before being processed because the ECS task scale-up takes longer than the queue's default message age limit. Which TWO actions should the developer take to resolve these issues? (Select TWO.)
- Increase the VisibilityTimeout attribute of Queue A to a value greater than the maximum document processing time, such as 60 seconds.Cevap
- Increase the MessageRetentionPeriod attribute of Queue A to a higher value, such as 4 days.Cevap
- CDecrease the VisibilityTimeout attribute of Queue A to 15 seconds to ensure that unprocessed messages are quickly made available to other ECS tasks.
- DEnable Content-Based Deduplication on Queue A to automatically filter out duplicate message deliveries.
- ESet the SNS subscription delivery policy retry backoff to 45 seconds to throttle message delivery to Queue A.
Cevap
The developer should increase the VisibilityTimeout attribute of Queue A to a value greater than the maximum document processing time (such as 60 seconds) and increase the MessageRetentionPeriod attribute of Queue A to a higher value (such as 4 days).
Increasing the SQS visibility timeout to a value larger than the consumer processing time ensures that the consumer can complete the task and delete the message before another consumer picks it up. Increasing the message retention period ensures that messages stay in the queue during scaling delays instead of being discarded.
Adım Adım Çözüm
Anahtar Kavram
Configuring SQS Visibility Timeout and Message Retention Period for Consumer Capacity Alignment