MQTT is a lightweight publish/subscribe messaging protocol, an OASIS standard, in which devices send messages to named topics on a broker and any subscribed application receives them.
In MQTT, clients never talk to each other directly. A publisher sends a message to a topic, such as plant1/line3/filler/speed, on a central server called a broker. Subscribers tell the broker which topics they want. Wildcards help: + matches one topic level, # matches all remaining levels. The broker can keep the last retained message on a topic, so a new subscriber immediately gets the current value.
MQTT offers three quality-of-service levels. QoS 0 delivers at most once, with possible loss. QoS 1 delivers at least once, with possible duplicates. QoS 2 delivers exactly once, at more overhead. Headers are small and client code is compact, which suits constrained devices and unreliable networks. TLS encryption and authentication are supported but must be configured.
MQTT defines transport, not meaning. The payload can be JSON, binary or anything else, and topic names are up to you. Without conventions, two teams will name the same signal differently. Sparkplug, an Eclipse specification, adds a topic structure, payload encoding and device state management for industrial use. MQTT is the usual backbone of a unified namespace.
MQTT vs OPC UA
| MQTT | OPC UA | |
|---|---|---|
| Pattern | Publish/subscribe through a broker | Client-server, plus a publish/subscribe model defined in Part 14 |
| Maintained by | OASIS | OPC Foundation |
| Meaning of the data | Not defined: topic names and payload format are up to you | Defined: an information model that clients can browse |
| Built-in functions | Three quality-of-service levels, retained messages, TLS | Read and write, subscriptions, events, method calls, history, encryption and authentication |
| Typical role | Moving data from many devices to many consumers | Structured access to a machine or controller |
Questions about MQTT
Is MQTT better than OPC UA?
Neither replaces the other. MQTT moves messages and says nothing about what they mean. OPC UA describes the data with an information model and offers services such as browsing, reading, writing and method calls. Which fits depends on whether the job is transport or structured access.
Can OPC UA run over MQTT?
Yes. Part 14 of the OPC UA specification defines a publish/subscribe model that complements client-server, and it includes a mapping to MQTT as a transport.
Do plants use both?
Often. A common setup has an edge gateway read a machine through OPC UA or a PLC protocol and publish the values to an MQTT broker, where dashboards, historians and models subscribe.
MQTT in real plants
- Gousto and HighByte: Meal-kit maker Gousto uses HighByte Intelligence Hub to model data from its factory PLCs at the edge and publish it to AWS, with a unified namespace on AWS IoT Core.
- Siemens Gamesa and HighByte: Siemens Gamesa uses HighByte Intelligence Hub to model plant data into a local unified namespace, used by engineers to monitor the blade casting mold control system.
- Catalent and HighByte: Catalent uses HighByte Intelligence Hub in its process development labs to model bioreactor and at-line equipment data and publish it to a HiveMQ broker for analytics and remote monitoring.
Related terms
Unified namespace (UNS)
A unified namespace (UNS) is an architecture pattern in which plant and business systems publish their current data to one shared, hierarchically organized hub, usually an MQTT broker, instead of exchanging it through point-to-point integrations.
Sparkplug B
Sparkplug B is the current payload definition of Eclipse Sparkplug, an open specification that tells MQTT clients in industrial systems which topic names to use, how to encode data, and how to report whether a device is online.
OPC UA
OPC UA (OPC Unified Architecture) is a platform-independent, open standard for exchanging industrial data securely between machines, controllers and software, published by the OPC Foundation and standardized as IEC 62541.
Industrial IoT (IIoT)
Industrial IoT (IIoT) is the network of sensors, instruments, and machines in industrial settings that are connected to computers and software to collect and use operational data.
Edge AI
Edge AI is running machine learning models on or near the device that produces the data, such as a camera, gateway, or industrial PC, instead of in a remote cloud.
IT/OT convergence
IT/OT convergence is the integration of information technology, the systems that handle business data, with operational technology, the systems that monitor and control physical equipment, so data and practices flow between them.