Why put SNS before two SQS queues instead of letting both workers share one queue?
After this you can answer: Why put SNS before two SQS queues instead of letting both workers share one queue?
Say it in 30 seconds
Section titled “Say it in 30 seconds”The deeper answer
Section titled “The deeper answer”The API publishes one versioned booking event. The infrastructure subscribes the email queue and tickets queue to the topic. Each queue has a resource policy allowing SNS to send from this exact topic and account. The workers have separate queue-reading permissions and separate failure queues.
This isolates a slow or broken email path from ticket generation. Queue retention still bounds the outage the system can absorb; buffering is not infinite storage. Consumers also validate their message contracts because persisted events may outlive a deployment.
The topic output waits for both subscriptions to exist before the publisher configuration uses it. That avoids starting a publisher with no routes during normal provisioning. It does not prove that a later policy change or subscription deletion cannot break delivery. Production verification should follow a known booking across both paths, not stop at the SNS acceptance log.
Counter-questions
Section titled “Counter-questions”What if raw delivery is switched off?
Why not call both queues from the API?
How do you find one missing consumer?
Where in MiniTickets
Section titled “Where in MiniTickets”Read Sns fan out, then inspect the booking-events-topic piece →.
infra/src/jobs/booking-events.ts → createBookingEvents
See the SNS delivers nothing case.
Read this book online: https://book.theversehub.in/