An image-processing company has a web application that uploads images to an Amazon S3 bucket. S3 event notifications publish object-creation events to an Amazon Simple Queue Service (Amazon SQS) standard queue. The SQS queue is the event source for an AWS Lambda function that processes images and emails results to users. Users report receiving multiple emails for each uploaded image. A solutions architect finds that SQS messages are invoking the Lambda function more than once, causing duplicate emails. What should the solutions architect do to resolve this issue with the LEAST operational overhead?
Choose an answer
Tap an option to check your answer.
Correct answer: Increase the visibility timeout in the SQS queue to a value greater than the total of the function timeout and the batch window timeout..
Why this is the answer
The correct answer is to increase the visibility timeout in the SQS queue. When a Lambda function processes a message from an SQS queue, the message becomes temporarily invisible to other consumers. If the visibility timeout is too short, the message can become visible again before the Lambda function finishes processing and deletes it. This can lead to the message being processed multiple times by the same or different Lambda invocations, causing duplicate emails. Setting the visibility timeout to be greater than the Lambda function's timeout and any batch window ensures the function has enough time to process and
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