OPC UA PubSub (Publish-Subscribe) is a communication model defined in Part 14 of the OPC Unified Architecture (OPC UA) specification. It enables one-to-many data distribution, where a Publisher sends data messages to a message bus or network without needing a direct connection to each Subscriber. Subscribers receive only the data they have registered interest in. Unlike the traditional OPC UA Client-Server model — where a client must poll or maintain a session with a specific server — PubSub decouples senders from receivers, making it highly scalable and well suited for Industrial IoT (IIoT), edge computing, and cloud integration scenarios.
How OPC UA PubSub Differs from Client-Server
The classic OPC UA communication model is Client-Server: a client establishes a session with a server, browses its address space, and subscribes to monitored items. This works well for point-to-point integrations, but it does not scale efficiently when many systems need the same data simultaneously.
PubSub removes that limitation. A Publisher broadcasts data to a shared channel — either directly over a network (broker-less) or via a message broker. Any number of Subscribers can consume that data without the Publisher needing to know who they are or how many there are. This decoupling of sender and receiver is the defining characteristic of the publish-subscribe pattern.
Key Components of OPC UA PubSub
OPC UA PubSub introduces several specific entities:
- Publisher — The data source. It organises data into WriterGroups and DataSetWriters, then sends NetworkMessages at configured intervals or on change.
- Subscriber — The data consumer. It uses DataSetReaders to filter and process incoming DataSetMessages.
- WriterGroup — A logical grouping of DataSetWriters that share settings such as publish interval, security configuration, and encoding.
- DataSetWriter — Defines how a specific dataset is serialised and packaged into a NetworkMessage.
- DataSetReader — The Subscriber-side counterpart; maps incoming DataSetMessages to local variables.
- NetworkMessage — The container transmitted over the wire. Each NetworkMessage can carry one or more DataSetMessages.
- Broker (optional) — In broker-based deployments, middleware such as an MQTT or AMQP broker relays messages from Publishers to Subscribers.
Transport Models: Broker-Based vs. Broker-Less
OPC UA PubSub supports two distinct transport architectures:
Broker-Less (Direct Transport)
Data is sent directly over the network using UDP/IP or Ethernet multicast (UADP — UA Datagram Protocol). This approach has very low latency and is commonly used within a plant floor or local industrial network where all devices share the same subnet.
Broker-Based (Message-Oriented Middleware)
Publishers and Subscribers communicate through a central broker. Supported broker protocols include MQTT (ISO/IEC 20922) and AMQP (ISO/IEC 19464). The broker handles delivery, queuing, and fan-out to multiple Subscribers. This model is the standard approach for cloud integration, edge-to-cloud pipelines, and wide-area IIoT architectures.
Message Encoding: UADP and JSON
OPC UA PubSub supports two message encoding formats:
- UADP (UA Datagram Protocol) — A compact, optimised binary encoding. Efficient for high-frequency data on bandwidth-constrained networks. Supports optional end-to-end message security.
- JSON — A human-readable text encoding. Enables interoperability with web and enterprise software that does not have native OPC UA support, making it ideal for cloud platforms and REST-based systems.
Both encodings can be carried over any supported transport, giving implementers flexibility to match encoding to the deployment context.
OPC UA PubSub vs. Client-Server: A Comparison
| Feature | Client-Server | PubSub |
|---|---|---|
| Communication pattern | Point-to-point | One-to-many |
| Session required | Yes | No |
| Scalability | Moderate | High |
| Typical transport | TCP/IP (OPC UA binary) | MQTT, AMQP, UDP |
| Best suited for | Targeted queries, writes | Data distribution, monitoring |
| Cloud integration | Via gateway | Native (MQTT/AMQP) |
Real-World Use Cases
Manufacturing Line Monitoring
A PLC or edge controller acts as a Publisher, broadcasting machine status, production counts, and temperature values at regular intervals. Multiple SCADA systems, MES platforms, and historian applications consume that data simultaneously without each needing its own server connection.
IIoT and Cloud Integration
An OPC UA PubSub Publisher at the edge publishes process data over MQTT to a cloud broker. Cloud analytics, dashboards, and digital twin platforms subscribe to the relevant topics. This removes the need for a dedicated OPC UA server session to the cloud.
Plant-Wide Data Distribution
In large facilities with hundreds of data sources, PubSub over UDP multicast allows all interested systems on the network to receive data without individual polling, dramatically reducing network overhead.
Security in OPC UA PubSub
Security in PubSub operates at two levels. In broker-based deployments, transport-level security protects the connection between each participant and the broker (TLS/SSL). End-to-end message security is also supported, ensuring that data is authenticated and integrity-protected between the Publisher and Subscriber, even when traversing an untrusted broker. Broker access requires credentials, limiting which Publishers and Subscribers can participate in a given topic or queue.
OPC UA PubSub and MQTT
MQTT is the most widely adopted transport for OPC UA PubSub in IIoT deployments. An OPC UA Publisher maps its DataSetWriters to MQTT topics. Subscribers connect to the MQTT broker and receive DataSetMessages when data is published. The combination of OPC UA’s rich information model with MQTT’s lightweight, broker-based delivery makes this pairing a practical foundation for plant-floor-to-cloud architectures.
Tools such as OPC Expert support MQTT publish, subscribe, and broker functions, enabling engineers to bridge OPC UA data sources to MQTT-based systems without custom development. The OPC Foundation provides the full PubSub specification as part of the OPC UA standard.
Summary
OPC UA PubSub extends the OPC UA framework with a scalable, decoupled communication model for data distribution. It supports broker-less (UDP) and broker-based (MQTT, AMQP) transports, binary (UADP) and JSON encodings, and includes end-to-end security. For IIoT, cloud integration, and large-scale industrial monitoring, PubSub complements the traditional Client-Server model by removing the session dependency and enabling true one-to-many data delivery.