What it is
In publish subscribe, a publisher sends a message to a topic and every subscriber registered on that topic receives a copy. The publisher does not know who the subscribers are.
How it works
- A publisher writes a message to a named topic.
- The messaging system delivers a separate copy to each active subscriber.
- Subscribers come and go without the publisher changing.
Why it matters
- Gives loose coupling: senders and receivers never reference each other directly.
- Supports broadcast and event driven designs where many services react to one event.
- Makes the system extensible: add a subscriber without touching producers.
The tradeoff is reduced control. The publisher cannot guarantee a subscriber acted, and subscribers added after a message was sent may miss it unless the system retains history.
Key idea
Publish subscribe delivers one published message to all subscribers of a topic, decoupling producers from an unknown set of consumers.