How should you configure the system to ensure reliable processing and no message loss?
hard📝 Best Practice Q15 of 15
AWS - SNS and SQS
You want to build a system where an SNS topic sends messages to three SQS queues. One queue processes orders, another sends notifications, and the third logs events. How should you configure the system to ensure reliable processing and no message loss?
ASubscribe only the order queue to SNS and forward messages to others manually
BSend messages directly to each SQS queue without SNS
CUse one SQS queue for all processing and filter messages inside the consumer
DSubscribe all three SQS queues to the SNS topic, enable dead-letter queues for each, and set appropriate message retention
Step-by-Step Solution
Solution:
Step 1: Use SNS fan-out to send messages to all queues
Subscribing all three SQS queues to the SNS topic ensures each gets the message.
Step 2: Enable dead-letter queues and set retention