Question

Difficulty: MediumMessage-Based Integration using Amazon SQS and SNS

A developer is designing a system for an online gaming platform where player score updates must be processed in the exact order they occur. The platform must also fan out these updates to both a leaderboard service and an archiving service, ensuring each service receives a copy of every update. Which combination of configurations will meet these requirements? (Select TWO.)

  1. Publish the score updates to an Amazon SNS FIFO topic.Answer
  2. Subscribe two Amazon SQS FIFO queues to the SNS FIFO topic, one for each consumer service.Answer
  3. C
    Publish the score updates to an Amazon SNS standard topic and enable raw message delivery on the subscriptions.
  4. D
    Subscribe two Amazon SQS standard queues to the SNS FIFO topic, as SNS FIFO topics can deliver messages in an ordered sequence to standard queues.
  5. E
    Set the visibility timeout of the SQS queues to 00 seconds to ensure that consumer instances immediately receive the next ordered message in the queue.

Answer

Publish the score updates to an Amazon SNS FIFO topic, and subscribe two Amazon SQS FIFO queues to the SNS FIFO topic, with one queue dedicated to each consumer service.
To achieve ordered processing and message fanout, the developer must use an Amazon SNS FIFO topic combined with Amazon SQS FIFO queues. SNS FIFO topics preserve the order of messages, and when SQS FIFO queues are subscribed to them, the ordering is maintained end-to-end. By creating two SQS FIFO queues (one for the leaderboard and one for archiving), both services receive every message in the correct sequence.

Step-by-Step Solution

1
Select the appropriate messaging topic type that supports message ordering.
An Amazon SNS FIFO topic is chosen to ensure that message ordering and deduplication are maintained at the ingress point.
Standard SNS topics do not guarantee first-in-first-out (FIFO) delivery or message deduplication.
2
Configure SQS queues to preserve message ordering and support fanout from the SNS FIFO topic.
Two SQS FIFO queues are created and subscribed to the SNS FIFO topic, one for the leaderboard service and one for the archiving service.
Standard SQS queues cannot guarantee message ordering. Subscribing two SQS FIFO queues to the SNS FIFO topic enables a fanout pattern while preserving message ordering for each consumer service.

Key Concept

End-to-end message ordering using Amazon SNS FIFO and Amazon SQS FIFO fanout integration.
Rate this question