A developer is designing an integration for an e-commerce platform's inventory and shipping services. When a customer places an order, both the inventory service and the shipping service must receive the order details. The services must process orders in the exact order they were placed to maintain correct inventory levels and shipping sequences. If processing fails for a specific customer's order, it must not block the processing of orders for other customers. Which combination of actions will meet these requirements? (Select TWO.)
- Publish the order events to an Amazon SNS FIFO topic, and subscribe two Amazon SQS FIFO queues to the topic to fan out the messages.Cevap
- Use the customer ID as the MessageGroupId when publishing the order events.Cevap
- CUse a single standard Amazon SQS queue, and configure both the inventory and shipping services as competing consumers.
- DConfigure the SQS visibility timeout to be shorter than the downstream consumer's processing time.
- EConfigure the downstream Lambda function's timeout to be greater than the SQS queue's visibility timeout.
Cevap
Publish the order events to an Amazon SNS FIFO topic, subscribe two Amazon SQS FIFO queues to the topic to fan out the messages, and use the customer ID as the MessageGroupId when publishing the order events.
Publishing the order events to an Amazon SNS FIFO topic and subscribing two Amazon SQS FIFO queues allows for ordered fanout, ensuring both downstream services receive every message in the correct sequence. Using the customer ID as the MessageGroupId ensures that messages belonging to the same customer are processed in the order they were received, while messages for different customers are processed in parallel without causing head-of-line blocking.
Adım Adım Çözüm
Anahtar Kavram
FIFO Fanout with SNS and SQS using MessageGroupId for logical partitioning