DVA-C03 practice question: Messaging with SQS, SNS and EventBridge (2 of 2)
Development with AWS Services A free question from our original DVA-C03 practice exam. Try it, then open the answer to see why each option is right or wrong.
A payments service sends account events to an Amazon SQS queue.
Events for the same account must be processed strictly in the order they were sent, but events for different accounts can be processed in parallel. The producer adds a sentAt timestamp to every send, so a retry after a network timeout has a different message body from the original. The retry must not create a second message.
Which TWO actions meet these requirements? (Choose two.)
Choose two answers.
AA. Use a FIFO queue and set the MessageGroupId of each message to the account ID.
BB. Use a FIFO queue and set the same MessageGroupId on every message.
CC. Enable content-based deduplication on the FIFO queue, so SQS hashes each message body to find duplicates.
DD. Use a FIFO queue and set each message's MessageDeduplicationId to an event ID that the producer creates once and reuses on every retry.
EE. Use a standard queue with long polling and a dead-letter queue for failed events.
Show the answer and explanation
Answers: A, D
A. Right: Correct. Messages in one message group are processed one at a time in strict order, while different groups can be worked on in parallel.
B. Wrong: Ordering would hold, but every message would share one group, so all events would be processed one at a time and accounts could not run in parallel.
C. Wrong: Content-based deduplication hashes the message body only. The sentAt timestamp makes every retry's body different, so the retry would not be recognized as a duplicate.
D. Right: Correct. SQS discards a repeat send with the same deduplication ID within the 5-minute deduplication interval. An ID that does not change on a retry works even when the body differs.
E. Wrong: Standard queues give best-effort ordering and do not remove duplicates, so neither requirement is met.
Explanation
In a FIFO queue, the message group ID is the unit of ordering: messages in one group are processed in strict order, and different groups can be processed in parallel. Duplicates are dropped by deduplication ID within the 5-minute interval. Content-based deduplication uses only the message body, so a timestamp added to each send defeats it; an explicit ID generated once per event does not.
Want more on Messaging with SQS, SNS and EventBridge? The 5 full-length practice sets have 11 more Messaging with SQS, SNS and EventBridge questions, 390 in all, none of them in the free exam. One payment of $14.99, no subscription. See the practice sets →