Publish–subscribe pattern
lastmod 2025-11-17created 2020-12-216 edits
The publish–subscribe model is an asynchronous messaging paradigm. In the publish–subscribe model, a sender's messages are not addressed to specific receivers. Instead, published messages are characterized into predefined categories and delivered to the receivers that have subscribed to each category. Receivers can receive only the messages they want without any knowledge of the publishers. This decoupling of publishers and subscribers allows for more dynamic network topologies and greater scalability.
Publish–subscribe is a sibling of the message queue paradigm and is typically one part of a larger message-oriented middleware solution. Most messaging system APIs (e.g. JMS) support both the publish–subscribe and message queue models.
Libraries
- Nanomsg-next-gen (NNG)
- Nanomsg
- Hubble - Open-source subscription management system
- Crossbar
See also
- Software design pattern (Design pattern)
- PubGrub