Soru

Zorluk: OrtaMessage-Based Integration using Amazon SQS and SNS

A developer is designing a messaging architecture for an online medical clinic's appointment scheduling platform. When a patient schedules or updates an appointment, the system must broadcast this event to two downstream services:

1. A reminder service that sends SMS and email notifications to patients. This service does not require messages to be processed in order.
2. A calendar synchronization service that must process events in the exact chronological order they occurred to prevent scheduling conflicts.

Which combination of actions should the developer take to implement this architecture? (Select TWO.)

  1. Publish the appointment events to an Amazon SNS FIFO topic.Cevap
  2. Subscribe an Amazon SQS FIFO queue for the calendar synchronization service and a standard Amazon SQS queue for the reminder service to the Amazon SNS FIFO topic.Cevap
  3. C
    Publish the events to a standard Amazon SNS topic, subscribe a standard Amazon SQS queue for the calendar synchronization service, and set the queue's visibility timeout to 0 seconds to process messages in chronological order.
  4. D
    Create a single AWS Lambda function subscribed directly to a standard Amazon SNS topic, and store the last processed event timestamp in the Lambda execution context's global variables to manually reorder incoming events.
  5. E
    Configure the downstream services to pull from the queues by initializing the AWS SDK client with hardcoded AWS access keys and secret keys in the consumer application code.

Cevap

To implement this architecture, the developer should publish the appointment events to an Amazon SNS FIFO topic, and subscribe an Amazon SQS FIFO queue for the calendar synchronization service and a standard Amazon SQS queue for the reminder service to the SNS topic.
The correct solution involves publishing events to an Amazon SNS FIFO topic and subscribing both an Amazon SQS FIFO queue (for the calendar service) and a standard Amazon SQS queue (for the reminder service). SNS FIFO topics preserve message ordering and support fanout to both SQS FIFO queues (which guarantee order) and standard SQS queues (which handle unordered delivery).

Adım Adım Çözüm

1
Determine the topic type needed to support ordered delivery to downstream consumers.
Identify that an Amazon SNS FIFO topic is required because standard SNS topics do not support FIFO ordering or subscription of SQS FIFO queues.
An SNS FIFO topic ensures message ordering is preserved from the publisher and allows delivery to SQS FIFO queues.
2
Determine the queue types needed for each downstream service based on their ordering requirements.
Select an SQS FIFO queue for the calendar synchronization service (which requires strict chronological ordering) and a standard SQS queue for the reminder service (which does not require ordering).
SQS FIFO queues guarantee exactly-once processing and ordering, while standard SQS queues provide higher throughput for unordered tasks.
3
Subscribe both queues to the SNS FIFO topic.
Both the SQS FIFO queue and the standard SQS queue are successfully subscribed to the SNS FIFO topic.
Amazon SNS FIFO topics are fully compatible with both SQS FIFO and standard SQS queue subscriptions, enabling a fanout architecture that services both ordered and unordered consumers.

Anahtar Kavram

Amazon SNS FIFO and SQS FIFO integration (Fanout pattern)
Bu soruyu puanla