An airline is designing an application to process loyalty rewards points accrual events. For each passenger, events must be processed in the exact chronological sequence they are generated to ensure loyalty tiers are calculated accurately. If an event fails to process after five attempts, it must be isolated for investigation without blocking the processing of events for other passengers.
Which solution meets these requirements with the least operational overhead?
- AConfigure a standard Amazon SQS queue with an attached dead-letter queue. Set the passenger ID as a message attribute to guarantee that events for each passenger are processed in order.
- BConfigure an Amazon SNS standard topic to receive the events, and subscribe multiple Amazon SQS FIFO queues to the topic to process messages for each passenger in order.
- Configure an Amazon SQS FIFO queue with a dead-letter queue. Set the passenger ID as the message group ID to ensure in-order processing per passenger.Answer
- DConfigure an Amazon Kinesis Data Stream with a single shard to ingest all events, using the passenger ID as the partition key, and process events using an AWS Lambda consumer.
Answer
Configure an Amazon SQS FIFO queue with a dead-letter queue. Set the passenger ID as the message group ID to ensure in-order processing per passenger.
The correct solution uses an Amazon SQS FIFO queue. SQS FIFO queues guarantee that messages within the same message group (using the passenger ID as the MessageGroupId) are processed in the exact order they are received. An associated dead-letter queue (DLQ) isolates messages that fail to process after five attempts, allowing other message groups (other passengers) to continue processing without interruption.
Step-by-Step Solution
Key Concept
Decoupling message processing using Amazon SQS FIFO queues to guarantee ordered processing within groups (using MessageGroupId) and utilizing dead-letter queues to handle processing failures without blocking other groups.