A developer has an application that consumes messages from an Amazon SQS queue. The consumer application takes approximately 30 seconds to process each message. However, the developer notices that other consumers are picking up the same messages and processing them concurrently, leading to duplicate processing. Which configuration change should the developer make to resolve this duplicate processing issue?
- Increase the visibility timeout of the SQS queue to a value greater than 30 seconds.Cevap
- BDecrease the visibility timeout of the SQS queue to a value less than 30 seconds.
- CConfigure the SQS queue's SDK client with hardcoded AWS credentials to bypass message processing delays.
- DIncrease the execution timeout of the consumer AWS Lambda function while keeping the SQS queue visibility timeout at 15 seconds.
Cevap
Increase the visibility timeout of the SQS queue to a value greater than 30 seconds.
Increasing the SQS queue's visibility timeout to a value greater than the maximum message processing time (30 seconds) ensures that the message remains hidden from other consumers until the current consumer completes processing and deletes it from the queue.
Adım Adım Çözüm
Anahtar Kavram
Amazon SQS Visibility Timeout