A developer is designing an event-driven transaction ingestion pipeline for a financial application. When a customer performs a transaction, the event must be published to Amazon SNS and consumed by two downstream applications:
1. An auditing service that requires transaction events to be processed in the exact order they occurred per customer.
2. A reconciliation service that does not require ordered processing but must ensure that no duplicate events are processed.
Which combination of actions should the developer perform to meet these requirements? (Select TWO.)
- Create an Amazon SNS FIFO topic and subscribe two Amazon SQS FIFO queues to the topic, one for each backend service.Answer
- Publish messages to the SNS FIFO topic by specifying a consistent MessageGroupId based on the customer identifier and providing a unique MessageDeduplicationId for each transaction.Answer
- CCreate an Amazon SNS FIFO topic, subscribe an Amazon SQS FIFO queue for the auditing service, and subscribe an Amazon SQS standard queue for the reconciliation service.
- DConfigure the visibility timeout of the SQS queues to be shorter than the message processing time of the backend services to allow rapid reprocessing of duplicate events.
- EHardcode the AWS access key and secret access key in the initialization of the AWS SDK client within the publishing application to optimize delivery performance.
Answer
To configure the integration, create an Amazon SNS FIFO topic and subscribe two Amazon SQS FIFO queues to it. Then, publish messages to the SNS FIFO topic using a consistent MessageGroupId based on the customer identifier and providing a unique MessageDeduplicationId for each transaction.
To achieve transaction ordering per customer and prevent duplicates across two separate downstream consumers, the architecture must utilize an Amazon SNS FIFO topic fanning out to two separate Amazon SQS FIFO queues. SNS FIFO topics only allow SQS FIFO queues as subscribers. Messages published to the SNS FIFO topic must include a consistent MessageGroupId (such as the customer ID) to guarantee ordered delivery for each customer group, and a MessageDeduplicationId to ensure transaction-level deduplication.
Step-by-Step Solution
Key Concept
Amazon SNS FIFO to Amazon SQS FIFO Fanout Integration