Use this when many subscribers receive the same messages.
Pub/Sub
Pub/sub (publish-subscribe) lets publishers send messages to topics that many subscribers receive independently, such as Kafka, MQTT, Redis or Google Pub/Sub.
1. Pub/sub broadcasts messages to many subscribers.
2. Subscribers process independently.
3. Consumer groups for scaling.
4. Retention allows replay.
5. Monitor lag.
publisher → topic → subscriptions → consumers
Context & applicabilityCommon mistakes · platform/version boundaries
Operational reference
Fast context before you go deeper.
Verification & Troubleshooting
Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.
Use the operational verification above to establish the expected state.
Capture the concrete output, symptom, packet, log or counter before changing anything.
Step 1 Verification path Verify boundary
The negative fixture should deliberately exercise risks such as duplicate delivery, out-of-order events, poison messages, schema drift, dropped acknowledgements, retry amplification and action success inferred from broker acknowledgement, choosing the cases most relevant to topic/subscription identity, fan-out, acknowledgement/redelivery, ordering keys and per-subscriber lag/failure behavior.
Step 2 Common mistakes Narrow the fault
- Using pub/sub for work that must be done exactly once.
- Subscribers that miss messages while offline (no durable subscription).
Evidence · 1 on this Topic
Expected observations and documentation recipes are reference material. Record actual output, device identity, scope and time before claiming a verified result.
- Topics with subscribers.
- Each subscriber independent.
- Ordering may vary.
- Topics and subscriptions — fan-out
kafka-consumer-groups.sh --bootstrap-server <b> --describe --group <g>— Kafka lag- Subscription filters — delivery scope
ReferenceWhy it matters1 section · depth on demand
What it is
Publish/subscribe sends each message to every subscriber of a topic, unlike a queue where one consumer takes each message.
ReferenceImportant terms & boundaries2 sections · depth on demand
In depth
Publish/subscribe (pub/sub) is a messaging pattern where publishers send a message to a topic and every subscriber of that topic receives a copy. Unlike a work queue, where each message goes to one consumer, pub/sub broadcasts: one "device added" event can update monitoring, backups and documentation at once.
| Work queue | Pub/sub | |
|---|---|---|
| Delivery | One consumer per message | Every subscriber |
| Use | Distributing jobs | Notifying many systems |
| Adding a consumer | Shares the load | Gets its own copy |
Subscribers that are offline may miss messages unless the system keeps per-subscriber state (durable subscriptions, Kafka consumer groups). Decide whether missed events must be replayed or can be skipped.
Example
| Queue | Pub/Sub |
|---|---|
| One consumer per message | Every subscriber gets a copy |
| Work distribution | Fan-out notifications |
Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Verification history & basis
When and against what this Topic was checked. Later text edits do not count as a new check.
Authoritative/upstream documentation reviewed for bounded claims in Event-Driven Automation > Pub/Sub. Documentation verification only; this is not observed lab or production Evidence.
Basis: https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md · confidence 94%Deep reference
Healthy vs suspicious evidence
Output interpretation
For topic/subscription identity, fan-out, acknowledgement/redelivery, ordering keys and per-subscriber lag/failure behavior, prefer typed fields and stable IDs over human presentation text.