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.)
- 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
- 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
- CSet 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.
- DConfigure an Amazon Kinesis Data Stream with a static partition key string value to order and stream all events to the downstream consumer applications.
- EHardcode 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
Key Concept
Decoupling microservices using Amazon SNS FIFO topics and Amazon SQS FIFO queues with subscription filter policies.