DVA-C02 Question 398
Single answerA developer is designing a serverless application that processes customer orders. The application needs to: 1) Ensure that customer orders are processed exactly once. 2) Handle scenarios where multiple order-processing services consume the messages concurrently. Which AWS messaging service and feature combination should the developer use to meet these requirements?
- A
Amazon SQS Standard Queue with default settings
- B
Amazon SQS FIFO Queue with message deduplication
- C
Amazon SNS with multiple subscriptions for each order-processing service
- D
Amazon SQS FIFO Queue without enabling deduplication
Show answer and explanation
Correct answer: B
Explanation
To meet the requirements of processing customer orders exactly once and handling concurrent consumers, the correct choice is Amazon SQS FIFO Queue with message deduplication. FIFO queues ensure exactly-once processing and maintain the order of messages. Additionally, message deduplication prevents duplicate messages from being processed by multiple consumers.
- A. Incorrect.
Amazon SQS Standard Queue does not guarantee exactly-once processing. Standard queues provide at-least-once delivery and may result in duplicate messages, which does not meet the requirements.
- B. Correct.
Amazon SQS FIFO Queue with message deduplication ensures exactly-once message processing by eliminating duplicate messages. It also guarantees the order of messages, making it suitable for scenarios where multiple consumers process messages.
- C. Incorrect.
Amazon SNS is a pub/sub messaging service and does not provide the mechanisms required to ensure exactly-once processing. While SNS can send messages to multiple subscribers, it does not handle deduplication or order guarantees.
- D. Incorrect.
Amazon SQS FIFO Queue without enabling deduplication does not meet the requirement of exactly-once processing, as duplicate messages could still be processed by consumers.