Inferensys

Glossary

OPC UA PubSub over MQTT

A transport protocol mapping that uses the lightweight MQTT publish-subscribe broker to distribute OPC UA DataSet messages, commonly used in cloud and IoT integrations.
Data scientist building training data pipeline on laptop, data preprocessing visible, technical workspace.
TRANSPORT PROTOCOL MAPPING

What is OPC UA PubSub over MQTT?

A lightweight transport mapping that combines the OPC UA Publish-Subscribe model with the MQTT protocol to enable efficient, broker-based industrial data distribution to cloud platforms and IoT applications.

OPC UA PubSub over MQTT is a transport protocol mapping that encodes OPC UA DataSetMessages as MQTT payloads, enabling publishers to send industrial telemetry to a central MQTT broker for distribution to multiple subscribers without requiring direct client-server sessions. This decouples field-level data producers from cloud-based consumers, using MQTT's lightweight publish-subscribe pattern to minimize bandwidth and simplify firewall traversal for IIoT integrations.

The mapping defines a standard JSON encoding for NetworkMessages and leverages MQTT topics to route DataSets based on application-defined filters. Unlike the client-server model, this approach supports one-to-many communication where a single publisher can feed multiple analytics engines, historians, or cloud services simultaneously. It is specified in OPC UA Part 14 and commonly used with brokers like Mosquitto or cloud IoT hubs to bridge operational technology with enterprise systems.

Architectural Capabilities

Key Features of OPC UA PubSub over MQTT

The OPC UA PubSub over MQTT transport profile combines the semantic richness of OPC UA information models with the lightweight, scalable distribution of the MQTT protocol. This architecture decouples industrial data producers from consumers, enabling efficient cloud integration and large-scale IoT deployments.

01

Broker-Centric Decoupling

Unlike the client-server model requiring direct sessions, PubSub over MQTT introduces a message broker that completely decouples publishers from subscribers. A publisher sends a Network Message containing a DataSet to a configured MQTT topic. Any number of subscribers can then receive that data by subscribing to the topic, without the publisher needing any knowledge of their existence. This spatial and temporal decoupling eliminates point-to-point connection complexity and allows dynamic addition of consumers without reconfiguring the data source.

02

JSON DataSet Message Encoding

The standard encoding for OPC UA PubSub over MQTT is JSON, making payloads human-readable and directly consumable by cloud services and web applications. Each MQTT message carries a single DataSetMessage, which contains a header with metadata like the DataSetWriterId and timestamp, followed by a payload of key-value pairs representing the published data fields. This contrasts with the binary UA Binary encoding used in client-server or TSN profiles, prioritizing interoperability with IT systems over raw bandwidth efficiency.

03

MQTT Topic Structure and Namespace

OPC UA PubSub defines a standardized mapping of its logical concepts to the MQTT topic namespace. The topic structure typically follows a pattern that encodes the PublisherId and optionally the DataSetWriterId, allowing subscribers to filter messages using MQTT wildcards. For example, a topic like opcua/Factory1/Cell3/PressStatus enables hierarchical topic structures that mirror the physical or logical layout of a facility. This allows MQTT brokers to efficiently route messages and enables subscribers to selectively receive only relevant data streams.

04

Security Mapping to MQTT Transports

Security is implemented by layering OPC UA's application-level security on top of MQTT's transport-level security. The connection between the OPC UA Publisher or Subscriber and the MQTT broker is secured using TLS, which provides encryption and broker authentication. OPC UA then adds message-level signing and encryption using its established Security Policies, ensuring end-to-end data integrity and confidentiality independent of the broker. This dual-layer approach means that even if the broker is compromised, the payload remains protected by OPC UA's proven security model.

05

Network Message Mapping and QoS

OPC UA PubSub maps its Network Message concept directly to an MQTT PUBLISH packet. The specification leverages MQTT's Quality of Service (QoS) levels to control delivery guarantees. QoS 0 (at most once) is suitable for high-frequency, loss-tolerant telemetry. QoS 1 (at least once) ensures delivery for critical events like alarms but may introduce duplicates. The choice of QoS allows system architects to balance the trade-off between reliability and bandwidth for different classes of industrial data within the same broker infrastructure.

06

Metadata Discovery via MQTT

To enable true plug-and-produce interoperability, OPC UA PubSub over MQTT includes a mechanism for publishing DataSetMetaData to a dedicated topic. This metadata describes the structure, names, and data types of the fields within a DataSet, allowing a subscriber to dynamically interpret incoming payloads without prior out-of-band configuration. A subscriber can listen on a well-known metadata topic, receive the JSON-encoded description of a DataSet, and automatically configure its parsing logic. This is critical for maintaining semantic understanding in loosely coupled, large-scale systems.

OPC UA PubSub over MQTT

Frequently Asked Questions

Clear answers to the most common questions about combining OPC UA's semantic data modeling with MQTT's lightweight publish-subscribe transport for industrial IoT and cloud integration.

OPC UA PubSub over MQTT is a transport protocol mapping that combines the semantic data modeling of OPC UA with the lightweight publish-subscribe mechanism of MQTT to distribute industrial data to cloud and IoT applications. In this architecture, an OPC UA Publisher encodes a DataSet—a predefined collection of field-level data values—into a Network Message using either UA Binary or JSON Encoding. This message is then published to a specific MQTT topic on a central broker. Any Subscriber application, such as a cloud analytics engine or dashboard, that has subscribed to that topic receives the data without needing a direct OPC UA Session with the publisher. This decoupling eliminates the need for complex firewall configurations and persistent client-server connections, making it ideal for high-latency, bandwidth-constrained, or massive-scale telemetry scenarios common in Industry 4.0 deployments.

Prasad Kumkar

About the author

Prasad Kumkar

CEO & MD, Inference Systems

Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.

His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.