A developer is designing a retail ordering system. When an order is placed, the payment service must notify both a Fulfillment service and an Inventory service. Both services must receive and process every order message independently. The Inventory service processes messages at a slower rate than the Fulfillment service, so each service must be able to buffer and consume messages at its own pace. Which combination of steps should the developer perform to meet these requirements? (Select TWO.)
- Publish the order messages to an Amazon SNS topic when an order is placed.Cevap
- Create two separate Amazon SQS queues—one for the Fulfillment service and one for the Inventory service—and subscribe both queues to the Amazon SNS topic.Cevap
- CCreate a single Amazon SQS queue for both services to poll, and configure the queue's visibility timeout to 0 seconds to allow concurrent processing.
- DHardcode the IAM access key and secret access key in the AWS SDK client configuration within the service applications to poll messages from the queue.
- EDeploy the consumer applications inside a private VPC subnet without a NAT Gateway or VPC Endpoint to access AWS messaging services.
Cevap
Publish the order messages to an Amazon SNS topic when an order is placed, and create two separate Amazon SQS queues—one for the Fulfillment service and one for the Inventory service—and subscribe both queues to the Amazon SNS topic.
Publishing messages to an SNS topic and subscribing separate SQS queues for the Fulfillment and Inventory services implementation creates a reliable fan-out pattern. This ensures that every message is delivered to both queues, allowing each service to retrieve and process the messages independently and at its own pace.
Adım Adım Çözüm
Anahtar Kavram
Implementing the Amazon SNS-to-SQS fan-out pattern for decoupled, multi-consumer message processing.
Tahmini Süre:2m 0s