A developer is designing a decoupled backend architecture for a banking application to process real-time transaction events. The application requires that transaction events are processed in the strict order they occur, and duplicate transactions must be prevented. The developer configures an Amazon SNS FIFO topic to receive transaction events. The developer wants to fan out these events to two different backend consumer services: a ledger service and a fraud detection service. To support this, the developer creates an Amazon SQS FIFO queue named LedgerQueue.fifo and an Amazon SQS Standard queue named FraudQueue. When attempting to subscribe both queues to the SNS FIFO topic, the subscription for FraudQueue fails. How can the developer resolve this subscription failure while maintaining the application's strict ordering and duplication requirements?
- Convert the fraud detection queue to an Amazon SQS FIFO queue, rename it to FraudQueue.fifo, and subscribe it to the Amazon SNS FIFO topic.Answer
- BInitialize the AWS SDK client used by the publisher with hardcoded AWS access keys that have IAM policy permissions to bypass Amazon SNS FIFO delivery restrictions.
- CConfigure the standard queue's visibility timeout to 0 seconds to ensure immediate message delivery from the Amazon SNS FIFO topic.
- DCreate an intermediate AWS Lambda function with a custom timeout that reads from the topic and writes to the standard queue, relying on Lambda execution context reuse to maintain ordering.