liveBook · Manning

Publish-subscribe pattern

Also called publish-subscribe model

The publish-subscribe pattern is a messaging model in which publishers send messages to channels or topics and subscribers receive messages for which they have registered interest, without direct coupling between them.

How 8 Manning books explain it

Robotics for Programmers

Publish-subscribe is a communication pattern in which publishers send messages to named channels and subscribers receive them without direct coupling.

How it is used
Decouples robot components so sensing, planning, and other nodes communicate despite changing deployment locations.
How deep it goes
Defines topics, publishers, subscribers, message types, callbacks, and ROS node connections through working Python examples.
Examples
Uses detected-object messages from image processing to planning and paired ROS String publisher/subscriber nodes.
What you can do after
Apply it via rclpy by creating typed publishers and subscriptions connected through shared topic names.

Read how Robotics for Programmers explains publish-subscribe pattern →

Microservices Patterns, Second Edition

A messaging channel that distributes each published message to subscribing consumers.

How it is used
Uses publish/subscribe to distribute domain events and coordinate services asynchronously.
How deep it goes
Explains channel delivery, ownership, technology-selection criteria, and a saga flow without a framework-specific implementation.
Examples
Illustrates Order and Delivery event channels and a credit-reservation saga triggered by order events.
What you can do after
Evaluate and design publish-subscribe channels by comparing delivery requirements and messaging technologies.

Read how Microservices Patterns, Second Edition explains publish-subscribe pattern →

ActiveMQ in Action

Publish/subscribe messaging is a messaging style in which publishers send messages to topics for delivery to subscribers.

How it is used
Uses topics to broadcast stock price messages to multiple interested subscribers.
How deep it goes
Explains topic delivery, synchronous and asynchronous receiving, and durable subscriptions, then outlines a concrete publisher and consumer setup.
Examples
Illustrates one-to-many delivery with a mailing list and a stock portfolio broadcasting prices across topics.
What you can do after
Evaluate when topic broadcasting or point-to-point queue delivery fits a messaging scenario.

Read how ActiveMQ in Action explains publish-subscribe pattern →

Apache Kafka in Action

A publish-subscribe model lets publishers send messages to named channels while subscribers independently receive messages from those channels.

How it is used
Connects services through asynchronous, topic-based message exchange for streaming data and integration.
How deep it goes
Explains producers, consumers, topics, partitions, brokers, persistence, replication, and scaling, but not client implementation details.
Examples
Uses finance, manufacturing, retail, fraud detection, inventory management, order processing, and network monitoring examples.
What you can do after
Apply it via Apache Kafka to connect producers and consumers, distribute events, and support scalable real-time data flows.

Read how Apache Kafka in Action explains publish-subscribe pattern →

Object-Oriented Software Design in C++

A communication model in which a publisher provides state or event information to one or more subscribers without depending on their specific behavior.

How it is used
Deploys one-to-many event or state distribution when multiple components must react independently to changing content.
How deep it goes
Defines notification, content requests, subscription, and coupling, then contrasts them with a hardcoded C++ distributor.
Examples
Uses an online news service and baseball hit events feeding log, graph, and table reports.
What you can do after
Evaluate/understand how to separate event production from subscriber behavior and recognize hardcoded coupling that prevents independent subscription changes.

Read how Object-Oriented Software Design in C++ explains publish-subscribe pattern →

Kafka for Architects

A publish-subscribe pattern is a messaging pattern in which publishers send messages to subscribers without requiring direct knowledge of the subscribers.

How it is used
Decouples services in asynchronous, event-driven architectures by distributing one event to multiple independent consumers.
How deep it goes
Defines producer and subscriber roles, contrasts point-to-point delivery, and addresses routing and governance without implementation walkthroughs.
Examples
Uses customer address events, Kafka topics, independent business-service subscribers, and content-based routing into billing and shipping topics.
What you can do after
Apply via Kafka by publishing reusable events, subscribing services independently, and routing differently shaped messages through processing services.

Read how Kafka for Architects explains publish-subscribe pattern →

The Joy of JavaScript

An architecture in which publishers emit events or messages to subscribers without requiring direct coupling between them.

How it is used
Uses event-driven streams to separate data production from consumption and replace inefficient polling with notification.
How deep it goes
Explains sources, subscribers, push flow, lazy observables, and a custom EventEmitter-backed implementation.
Examples
Demonstrates EventEmitter listeners, Node.js readable streams, and a PushArray whose push operation notifies subscribers.
What you can do after
Build it from scratch by combining EventEmitter with subscription methods and a next(value) subscriber interface.

Read how The Joy of JavaScript explains publish-subscribe pattern →

Software Design for Python Programmers

The publisher-subscriber model is a communication pattern in which a publisher produces state or event information and subscribers receive notifications about it.

How it is used
Coordinates one publisher with multiple independently processing subscribers when changing state must reach interested components.
How deep it goes
Defines notification, fetching, independence, and subscription changes, but does not show implementation code.
Examples
Uses online news notifications and baseball hit events feeding logger, table, and graph reports.
What you can do after
Evaluate designs for loose coupling, selective content retrieval, and subscriber changes without publisher modifications.

Read how Software Design for Python Programmers explains publish-subscribe pattern →

Also covered in

What to know first

Related concepts

Questions about publish-subscribe pattern

What is publish-subscribe pattern?

The publish-subscribe pattern is a messaging model in which publishers send messages to channels or topics and subscribers receive messages for which they have registered interest, without direct coupling between them.

Which Manning books explain publish-subscribe pattern?

Robotics for Programmers, Microservices Patterns, Second Edition, ActiveMQ in Action, Apache Kafka in Action, Object-Oriented Software Design in C++, Kafka for Architects, The Joy of JavaScript and Software Design for Python Programmers.

What should I know before learning publish-subscribe pattern?

Manning books that teach publish-subscribe pattern usually introduce sink node, topic, message broker and producer first.

What is the difference between publish-subscribe pattern and point-to-point domain?

The publish-subscribe pattern is a messaging model in which publishers send messages to channels or topics and subscribers receive messages for which they have registered interest, without direct coupling between them. A JMS messaging style in which messages are sent to queues and each message is delivered to one consumer.

What is publish-subscribe pattern a kind of?

Publish-subscribe pattern is a kind of asynchronous communication. Asynchronous communication is the exchange of information without requiring participants to interact at the same time or the sender to wait for the receiver to process a message.

What is publish-subscribe pattern also called?

Publish-subscribe pattern is also called publish-subscribe model.

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.