Svashasan Logo
Simulated data

Vehicle Communication and Networking · Communication pattern

Publish-Subscribe Communication

Also known as pub/sub, publish/subscribe, topic-based messaging, event-based communication

BeginnerSource-checked · awaiting technical reviewLast reviewed 6 December 2026

A messaging pattern in which producers (publishers) send data to a named topic or event without knowing the receivers, and every consumer (subscriber) registered for that topic receives it, decoupling senders from receivers.

Explanation

Publish-subscribe suits continuous data streams such as sensor readings, vehicle state or status events, where many consumers need the same information. Publishers and subscribers can join or leave independently, and the system matches them by topic name and, in typed systems, by data type.

Implementations differ in where matching happens. MQTT uses a central broker that receives published messages and forwards them to subscribers. DDS and ROS 2 topics have no broker: endpoints discover each other and send data directly, with QoS policies governing reliability, history and deadlines. SOME/IP provides publish/subscribe through events and eventgroups negotiated by service discovery. Classical CAN behaves similarly at a lower level, since every frame is broadcast and receivers filter by identifier.

Decoupling makes systems flexible but hides dependencies: it can be hard to know who consumes a topic, and timing depends on middleware configuration. Request-response interactions and long-running tasks are better served by services or actions.

How it works

A publisher declares a topic and data type and writes samples. The broker or middleware finds the matching subscribers, either from subscriptions registered with a broker or through distributed discovery, and delivers each sample according to the configured QoS. Subscribers receive data through callbacks or queues and process it independently. Adding a new subscriber requires no change to the publisher.

Automotive applications

  • Distributing sensor data in perception pipelines
  • Vehicle-to-cloud telemetry through brokers
  • Broadcasting vehicle state to many ECUs
  • Recording and replaying data for testing

Example

On a ROS 2 vehicle platform, a wheel-speed publisher sends samples on /vehicle/wheel_speeds at 100 Hz. The odometry node, a data recorder and a diagnostics monitor each subscribe, and adding the recorder required no change to the publisher.

An illustrative example: any figures in it are worked numbers, not measurements.

References

  1. Topics (ROS 2 documentation source) (opens in a new tab)

    Open Robotics / ROS 2 documentation project · Project documentation · Publish/Subscribe; Anonymous; Strongly-typed (source of the docs.ros.org page; docs.ros.org blocked automated access) · retrieved 6 December 2026

    “A publish/subscribe system is one in which there are producers of data (publishers) and consumers of data (subscribers).”
  2. MQTT Version 5.0, OASIS Standard, 07 March 2019 (opens in a new tab)

    OASIS · Standard · Abstract · retrieved 6 December 2026

    “Use of the publish/subscribe message pattern which provides one-to-many message distribution and decoupling of applications.”
  3. SOME/IP technical details (opens in a new tab)

    some-ip.com (Dr. Lars Völker) · Publication · SOME/IP-SD; RPC and Messaging · retrieved 6 December 2026

Definitions are original summaries. Standards text is not reproduced; follow the links for the official publications.