The Core Services intro covers one topic and one queue in isolation. This page covers what happens when you put them together: an SNS topic with several SQS queues subscribed to it, so one publish reaches every queue at once.
This pattern is called fan-out. It is one of the most common shapes in event-driven AWS systems, and it is worth understanding on its own before moving into FIFO ordering, dead-letter queues, and filtering - the topics covered in the rest of this section.
A single SNS topic can have many subscribers. When a subscriber is an SQS queue, SNS writes a copy of the published message into that queue on every publish. Subscribe three queues to a topic and one Publish call results in three independent messages, one per queue, each with its own lifecycle.
This differs from sending directly to one queue. A direct SendMessage to a queue reaches exactly that queue and nothing else. Fan-out exists precisely because a producer often does not know, or should not need to know, how many consumers care about an event.
Note the queue's ARN, not its URL, is what Subscribe needs as the endpoint. The URL identifies the queue for SendMessage/ReceiveMessage calls; the ARN identifies it for cross-service permissions and subscriptions.
Two things make SQS-as-subscriber different from email or HTTPS subscribers: automatic confirmation and a required queue policy.
Automatic confirmation. Email and HTTPS subscriptions sit in PendingConfirmation until a human or endpoint confirms them. SQS (and Lambda) subscriptions confirm automatically the moment they are created, so they can receive messages right away with no manual step.
The queue policy. SNS delivering to SQS is a cross-service call, and SQS denies writes by default from anything other than the queue owner. Each subscribed queue needs a resource policy that grants the sns.amazonaws.com service principal sqs:SendMessage, typically scoped with a SourceArn condition matching the topic's ARN so only that topic can write to it.
Once both pieces are in place - subscription and queue policy - the flow per publish looks like this:
Producer calls Publish once on the topic.
SNS looks up every confirmed subscription on that topic.
For each SQS subscription, SNS calls SendMessage on that queue using its own permissions.
Each queue now holds an independent copy; workers on each queue receive, process, and delete on their own schedule.
If one worker's queue backs up or one worker crashes, the other queues are unaffected - each is a separate buffer with its own visibility timeout and its own dead-letter policy.
Fan-out combines the strengths of both services: SNS's push-to-many with SQS's durable, replayable buffering. Without SQS in the mix, SNS delivery is best-effort - a failed HTTPS or email delivery can eventually be dropped after retries. With SQS in the mix, a message sits in the queue until a worker explicitly deletes it, so a temporarily offline consumer does not lose events.
This pattern also decouples the number and identity of consumers from the producer. Adding a fourth queue to the order-events topic requires no change to the code that publishes order events - only a new Subscribe call and queue policy. That is the core value proposition: producers publish business facts, and consumers subscribe to the facts they care about.
Combine this with message attributes and subscription filter policies (covered later in this section) to let each queue receive only a relevant subset of messages, rather than every message published to the topic. And combine it with FIFO topics and queues when the order of related events within a group matters, since standard fan-out makes no ordering guarantee across queues or even within one queue.
"Fan-out means the queues share one copy of the message." They do not. Each subscribed queue gets its own independent copy with its own message id and receipt handle.
"Subscribing a queue works immediately without any extra setup." It needs a queue policy granting SNS permission to SendMessage; without it, SNS's deliveries fail silently from the producer's point of view (the Publish call still succeeds).
"Fan-out guarantees every queue processes messages in the same order." Standard topics and queues make no cross-queue or even same-queue ordering guarantee. Use FIFO for that.
"You need a queue per event type." One topic, one set of queues, and message attributes with subscription filters can route many event types without duplicating infrastructure.
What is the difference between subscribing SQS versus email to a topic?
SQS subscriptions confirm automatically and receive messages durably until a worker deletes them. Email subscriptions require the recipient to confirm first, and delivery is best-effort with no retry buffer beyond SNS's own retries.
Why didn't my subscribed queue receive any messages?
The most common cause is a missing queue policy. The queue must explicitly grant the sns.amazonaws.com principal permission to call SendMessage, usually scoped to the specific topic ARN.
Do all subscribed queues get identical messages?
Yes, each queue receives its own copy of the exact same published message body and attributes, unless a subscription filter policy narrows what that particular queue receives.
Is fan-out more expensive than sending directly to one queue?
You pay for each SendMessage SNS performs on your behalf, one per subscribed queue, plus the original Publish. For a handful of queues this is usually negligible next to the operational benefit of decoupled consumers.
Stack versions: This page was written for boto3 1.43.x (Python 3.10+) and the AWS SDK for JavaScript v3 (Node.js 18+). cGJxcnRodnFyZi52YnxwdHZiMTEyNXwyMDI2MDc=
Revisado por Chris St. John·Última actualización: 25 jul 2026