Question #849
A developer is troubleshooting duplicate notifications in a company's application. The application uses an Amazon SQS queue where messages are sent. An AWS Lambda function processes these messages and sends notifications via Amazon Simple Notification Service (SNS). Users report receiving duplicate notifications during peak traffic times. What are possible reasons for this? (Choose two.)
Standard SQS queues provide at-least-once message delivery.
Standard SQS queues guarantee exactly-once processing, so duplicates must be due to application logic errors.
Amazon SNS has incorrect topic permissions, leading to message reprocessing.
The SQS queue's visibility timeout is less than the Lambda function's timeout.
The Lambda function's execution role lacks permissions to publish to SNS.
Explanation
A. Standard SQS queues are designed for high throughput and provide at-least-once delivery, meaning duplicates can occur during peak traffic. This is inherent to standard queues, unlike FIFO queues, which guarantee exactly-once processing.
D. If the SQS visibility timeout is shorter than the Lambda function's execution time, the message becomes visible again before Lambda finishes processing. This allows another Lambda instance to process the same message, causing duplicates.
Why others are incorrect:
B: Standard SQS does not guarantee exactly-once processing; this is a feature of FIFO queues.
C: Incorrect SNS permissions would cause publishing failures, not duplicates.
E: Lack of SNS permissions would prevent notifications entirely, not cause duplicates.
Answer
The correct answer is: AD