In software architecture, publish–subscribe is a messaging pattern where senders of message passing|messages, called publishers, do not program the messages to be sent directly to specific receivers, called subscribers. Instead, published messages are characterized into classes, without knowledge of what, if any, subscribers there may be. Similarly, subscribers express interest in one or more classes, and only receive messages that are of interest, without knowledge of what, if any, publishers there are.
Pub/sub is a sibling of the message queue paradigm, and is typically one part of a larger message-oriented middleware system. Most messaging systems support both the pub/sub and message queue models in their application programming interface|API, e.g. Java Message Service (JMS).
This pattern provides greater network scalability and a more dynamic network topology.