Course menuDVA-C02

Exams / DVA-C02 / Messaging with SQS, SNS and EventBridge / Question 2

DVA-C02 practice question: Messaging with SQS, SNS and EventBridge (2 of 2)

Development with AWS Services A free question from our original DVA-C02 practice exam. Try it, then open the answer to see why each option is right or wrong.

A payments application sends account events to Amazon SQS. Events for the same account must be processed strictly in the order sent, but events for different accounts should be processed in parallel. After a network timeout, the producer sometimes resends an identical message body, and that resend must not create a second message. Which TWO actions meet these requirements? (Choose two.)

Choose two answers.

  1. A. Use a FIFO queue and set the MessageGroupId of each message to the account ID.
  2. B. Use a FIFO queue and set the same MessageGroupId on every message.
  3. C. Enable content-based deduplication on the FIFO queue.
  4. D. Use a standard queue with long polling and a dead-letter queue.
  5. E. Set a delivery delay on the queue so resent messages arrive later.
Show the answer and explanation

Answers: A, C

  • A. Right: Correct. Messages in one group are delivered in order, one at a time, while different groups can be processed in parallel.
  • B. Wrong: Ordering would hold, but all messages would be in one group and processed one at a time, so there would be no parallelism between accounts.
  • C. Right: Correct. SQS derives the deduplication ID from a SHA-256 hash of the body, so an identical resend within the deduplication interval is not added again.
  • D. Wrong: Standard queues give best-effort ordering and at-least-once delivery, so neither requirement is met.
  • E. Wrong: A delay postpones delivery but does not remove duplicates or affect ordering.

Explanation

In a FIFO queue the message group ID is the unit of ordering: order is kept within a group, and separate groups can be consumed concurrently. Deduplication drops a repeated send within the deduplication interval. Content-based deduplication suits this case because the retried body is identical.

Study

Keep practising

Answer questions with a score at the end, or practise just this topic with the explanation after each one. No sign-up needed.