A developer is troubleshooting an application that processes message payloads from an Amazon SQS queue. The application requires an average of 45 seconds to successfully process and delete each message. Currently, the same messages are being received and processed multiple times by the application. Which configuration change will prevent this behavior?
- AReduce the queue's Visibility Timeout parameter to 10 seconds to expedite message recycling.
- BIncrease the execution timeout of the consumer's AWS Lambda function without modifying queue settings.
- Modify the SQS queue settings to increase the Visibility Timeout parameter to a duration greater than 45 seconds.Cevap
- DEmbed raw AWS IAM credentials directly in the application code to speed up SDK client initialization.
Cevap
Modify the SQS queue settings to increase the Visibility Timeout parameter to a duration greater than 45 seconds.
The correct option is to modify the SQS queue settings to increase the Visibility Timeout parameter to a duration greater than 45 seconds. Amazon SQS uses the visibility timeout to prevent other consumers from processing a message while a current consumer is processing it. If the processing time is 45 seconds, the visibility timeout must be set to a value greater than 45 seconds (such as 60 seconds) to ensure the message is deleted before it becomes visible again.
Adım Adım Çözüm
Anahtar Kavram
SQS Visibility Timeout vs Message Processing Duration