An IoT-enabled smart parking management system generates vehicle entry and exit events that must be processed in the exact sequence they occur for each vehicle to calculate parking fees accurately. The events must be delivered to both a real-time billing application and an occupancy tracking dashboard. Both downstream applications must receive every event. Which solution meets these requirements while ensuring strict message ordering is preserved for each vehicle?
- APublish the events to a standard Amazon SNS topic. Subscribe two Amazon SQS Standard queues to the topic, one for each downstream application. Configure the downstream applications to sort the events using a timestamp attribute.
- BPublish the events to an Amazon SNS FIFO topic. Subscribe two Amazon SQS Standard queues to the topic, one for each downstream application, and use the vehicle ID as the message group ID.
- Publish the events to an Amazon SNS FIFO topic. Subscribe two Amazon SQS FIFO queues to the topic, one for each downstream application. Use the vehicle ID as the message group ID when publishing the events.Cevap
- DPublish the events to a standard Amazon SNS topic. Subscribe two Amazon SQS FIFO queues to the topic, one for each downstream application, and use the vehicle ID as the message group ID.
Cevap
Publish the events to an Amazon SNS FIFO topic, subscribe two Amazon SQS FIFO queues to the topic, and use the vehicle ID as the message group ID when publishing.
To preserve message ordering end-to-end and deliver every message to multiple downstream consumers (fan-out), both the Amazon SNS topic and the Amazon SQS queues must be configured as FIFO (First-In-First-Out). Publishing events to an SNS FIFO topic with a specific message group ID (the vehicle ID) ensures that all messages for that vehicle are grouped and processed sequentially. The SQS FIFO queues subscribed to the SNS FIFO topic will receive the messages in the exact order they were published, allowing each consumer to process them in sequence.
Adım Adım Çözüm
Anahtar Kavram
End-to-end first-in, first-out (FIFO) message ordering in fan-out architectures using Amazon SNS FIFO and Amazon SQS FIFO.