MQTT and Sparkplug in industry

Publish/subscribe with a broker: topics, QoS, retained messages and last will — and how Sparkplug B adds the structure and state management that plain MQTT lacks.

Publish / subscribe

MQTT clients do not talk to each other directly. A publisher sends a message to a topic on a broker (plant/line1/motor3/speed); every client subscribed to that topic (or a wildcard such as plant/+/motor3/#) receives it. Typical ports: TCP 1883, 8883 with TLS.

FeatureMeaning
QoS 0At most once, no acknowledgement
QoS 1At least once — duplicates possible
QoS 2Exactly once — handshake, more overhead
Retained messageBroker keeps the last value for new subscribers
Last WillMessage the broker publishes if a client disconnects ungracefully

What plain MQTT does not define

Topic names, payload format (JSON? binary?), units, timestamps, data types and how to know whether a value is stale. Every project invents its own — integration becomes custom work.

Sparkplug B

The Eclipse Sparkplug specification defines:

  • a topic namespace spBv1.0/<group>/<message type>/<edge node>/<device>;
  • message types NBIRTH/DBIRTH (all metrics with types and current values when a node or device comes online), NDATA/DDATA (changes only), NDEATH/DDEATH (via Last Will), NCMD/DCMD (commands);
  • a binary (Protocol Buffers) payload with metric names, data types, timestamps and sequence numbers.

A SCADA or historian ("host application") therefore knows every tag after the birth message and can mark values stale when a death message arrives.

MQTT vs OPC UA

MQTT is a lightweight transport for many-to-many distribution (edge to cloud, plant data hubs). OPC UA brings a rich information model and client/server access to the PLC. They are often combined: OPC UA at the machine, MQTT/Sparkplug toward plant and enterprise level — or OPC UA PubSub over MQTT.

Loading the map…

Sources

  1. MQTT — the standard for IoT messaging — mqtt.org
  2. Eclipse Sparkplug — Eclipse Foundation
  3. IANA Service Name and Transport Protocol Port Number Registry — IANA

Updated 2026-10-02