Soru

Zorluk: OrtaMessage-Based Integration using Amazon SQS and SNS

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.)

  1. Create an Amazon SNS FIFO topic and subscribe two Amazon SQS FIFO queues to the topic, one for each backend service.Cevap
  2. 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.Cevap
  3. C
    Create 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.
  4. D
    Configure 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.
  5. E
    Hardcode the AWS access key and secret access key in the initialization of the AWS SDK client within the publishing application to optimize delivery performance.

Cevap

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.

Adım Adım Çözüm

1
Identify downstream ordering and deduplication needs.
The application requires message ordering for one service and deduplication for both.
Standard queues and topics do not guarantee ordering or single-delivery, meaning FIFO resources must be selected.
2
Determine subscriber compatibility rules for Amazon SNS FIFO.
An Amazon SNS FIFO topic must be paired with SQS FIFO queues as subscribers.
SNS FIFO topics do not support standard SQS queues, requiring both services to use SQS FIFO queues regardless of whether they require ordering.
3
Define message parameters for publisher clients.
Set a consistent MessageGroupId based on the customer ID and provide a unique MessageDeduplicationId.
The MessageGroupId routes messages to the same message group to maintain ordering, while the MessageDeduplicationId ensures transactions are not processed multiple times.

Anahtar Kavram

Amazon SNS FIFO to Amazon SQS FIFO Fanout Integration
Bu soruyu puanla