messaging
Pub/Sub Broker
Publishers emit events to topics — all subscribers on that topic receive a copy of the message
Topics3
Subscribers3
Messages Sent0
Publisher
idle
Broker
3 topics
Subscribers
3 total
topic: orders(2 subscribers)
sub-1
no messages
sub-2
no messages
topic: payments(1 subscribers)
sub-3
no messages
topic: notifications(0 subscribers)
// event log
No events yet.
// how it works
- Publishers send to a named topic
- Broker fans out to all topic subscribers
- Subscribers are decoupled from publishers
- New subscribers get future messages only
// trade-offs
- Loose coupling — publishers don't know consumers
- Easy to add new subscribers dynamically
- No replay — missed messages are gone
- Ordering not guaranteed across subscribers