Publish/Subscribe Messaging Defined
In a publish/subscribe (pub/sub) product or application, clients address messages to a topic. Topics bind data producers to data consumers like a private radio station whose broadcast content consists of data that is appropriate only to a specific audience of "listeners" or data subscribers. Publishers and subscribers are generally anonymous and may dynamically publish or subscribe to the content hierarchy. The system takes care of distributing the messages arriving from a topic's publishers to its multiple subscribers. Topics retain messages only as long as it takes to distribute them to current subscribers.
Pub/sub messaging has the following characteristics.
- Each message may have multiple consumers.
- Publishers and subscribers have a timing dependency. A client that subscribes to a topic can consume only messages published after the client has created a subscription, and the subscriber must continue to be active in order for it to consume messages.
B2BPO relaxes this timing dependency to some extent by allowing subscribers to adjust subscription attributes to request historical data. Durable subscriptions like this can receive messages sent while the subscribers are not active and before a subscription first became active. Durable subscriptions provide the flexibility and reliability of queues but still allow clients to send messages to many recipients.