Question

Difficulty: MediumMessage-Based Integration using Amazon SQS and SNS

A developer is implementing a microservices-based subscription management system. When a customer's subscription changes, a backend service publishes a message. This message must be processed by three downstream components:

* A billing service that requires messages to be processed in the exact order they occurred to prevent payment conflicts, with zero duplicate deliveries.
* An email notification service that receives all subscription change events to send customer alerts.
* A marketing analytics engine that only processes subscription upgrade events.

Which combination of configuration steps will satisfy these requirements? (Select TWO.)

  1. Create an Amazon SNS FIFO topic to receive the subscription events, and subscribe Amazon SQS FIFO queues for the billing, email, and analytics services to this topic.Answer
  2. Configure an Amazon SNS subscription filter policy on the analytics service's queue subscription to only accept messages where the event type attribute is set to 'upgrade'.Answer
  3. C
    Set the billing queue's visibility timeout to be lower than the billing application's average message processing time to guarantee rapid sequential processing of subsequent messages.
  4. D
    Configure an Amazon Kinesis Data Stream with a static partition key string value to order and stream all events to the downstream consumer applications.
  5. E
    Hardcode the AWS credentials within the subscription service initialization code to establish a faster, direct connection to the SNS topic.

Answer

Create an Amazon SNS FIFO topic to receive the subscription events, and subscribe Amazon SQS FIFO queues for the billing, email, and analytics services to this topic; and configure an Amazon SNS subscription filter policy on the analytics service's queue subscription to only accept messages where the event type attribute is set to 'upgrade'.
To satisfy the requirements of message ordering and deduplication for the billing service, an Amazon SNS FIFO topic combined with Amazon SQS FIFO queues must be used. SNS FIFO topics only support SQS FIFO queues as subscribers. Therefore, SQS FIFO queues must be configured for all downstream services subscribing to the FIFO topic. To ensure the marketing analytics engine only processes subscription upgrade events, a subscription filter policy should be configured on the analytics service's subscription to inspect message attributes and filter out non-upgrade events.

Step-by-Step Solution

1
Analyze the message ordering and deduplication requirements for the billing service.
Identify that end-to-end FIFO (First-In-First-Out) ordering and exactly-once processing require Amazon SNS FIFO and Amazon SQS FIFO.
Standard SNS and SQS services do not guarantee strict ordering or duplicate prevention.
2
Determine the subscriber requirements for the SNS FIFO topic.
Recognize that Amazon SNS FIFO topics only support Amazon SQS FIFO queues as subscribers.
All downstream queues (billing, email, and analytics) must be SQS FIFO queues to subscribe to the SNS FIFO topic.
3
Apply event filtering for the marketing analytics engine.
Implement an SNS subscription filter policy on the analytics queue subscription to filter messages based on the event type attribute.
This offloads the filtering logic from the application to SNS, ensuring only upgrade events are delivered to the analytics queue.

Key Concept

Decoupling microservices using Amazon SNS FIFO topics and Amazon SQS FIFO queues with subscription filter policies.
Rate this question