Skip to content

Broadcast

eric edited this page Jun 12, 2026 · 1 revision

Broadcast

Broadcast pushes one message to a whole audience at once, without enumerating subscribers.

Broadcast to the realm

producer.produce('announcement', data, { broadcast: 'realm' });

Every connected member of the producer's realm receives it — including realm members that have no matching subscription for this producer/event (they receive it on the generic CONSUME-<event> channel; library subscribers receive it through their normal handlers). Realm isolation holds: other realms never see it.

In a cluster, a realm broadcast reaches realm members on every node.

Broadcast to a group

producer.produce('rollout', data, { broadcast: 'group', group: 'workers' });

One copy to each member of the named Consumer Groups — the opposite of the group's normal exactly-one-member delivery. Non-members receive nothing.

Semantics and caveats

  • Broadcast is fire-and-forget: nothing is enqueued for offline durable subscribers and no ACK tracking applies. For guaranteed fan-out, produce normally to durable subscribers instead.
  • A consumer holding several matching subscriptions (e.g. a specific one and an any-producer one) fires once per subscription — same as normal delivery.
  • Requires no special permission beyond the producer role.

When to use which

Goal Use
All subscribers of an event get it, with durability/ACK normal produce()
Everyone in the realm right now, best-effort { broadcast: 'realm' }
Every member of a worker pool (config push, cache flush) { broadcast: 'group', group }
Exactly one member of a worker pool per message subscription { group }Consumer Groups

Clone this wiki locally