Question

Difficulty: EasyMessage-Based Integration using Amazon SQS and SNS

A developer is designing a system where order events must be processed independently by both an inventory management service and a shipping notification service. Each service must receive its own copy of every order event. Which of the following configurations should the developer implement? (Select TWO.)

  1. Publish order events to an Amazon SNS topic.Answer
  2. Create two separate Amazon SQS queues, subscribe them to the SNS topic, and have each service consume from its own queue.Answer
  3. C
    Configure a single Amazon SQS queue and set the visibility timeout to 0 seconds so that both services can retrieve the same event simultaneously.
  4. D
    Embed AWS access keys directly in the application source code during initialization of the AWS SDK client.
  5. E
    Set the processing Lambda function execution timeout to 10 minutes and configure the source SQS queue's visibility timeout to 30 seconds.

Answer

Publish order events to an Amazon SNS topic, and create two separate Amazon SQS queues, subscribe them to the SNS topic, and have each service consume from its own queue.
To decouple services and ensure that both the inventory management and shipping notification services receive every order event, a fan-out pattern must be implemented. This is accomplished by publishing events to an Amazon SNS topic and subscribing two separate Amazon SQS queues (one for each service) to that topic. This setup guarantees that each queue receives a copy of every published event and processes it independently.

Step-by-Step Solution

1
Select a message distribution service that supports publishing messages to multiple consumers simultaneously.
Amazon SNS is chosen as the message publisher to support the fan-out pattern.
Amazon SNS enables a single publisher to broadcast messages to multiple destinations.
2
Configure separate consumer queues to isolate processing failures and maintain decoupling.
Two SQS queues are created, one for each backend service, and subscribed to the SNS topic.
This allows each backend service to process messages at its own pace and guarantees that both services receive every event independently.

Key Concept

Message fan-out using Amazon SNS and SQS queues
Rate this question