Glossary

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.

MQTT defines how messages travel, not what they look like. Its specification sets no topic naming scheme and no payload format, and it leaves session state for each project to work out. Sparkplug fills those three gaps so that devices and applications from different vendors can work together without custom mapping.

Every Sparkplug topic follows one structure: namespace/group_id/message_type/edge_node_id/[device_id]. For Sparkplug B the namespace is spBv1.0. The payload is encoded with Google Protocol Buffers and carries metrics with timestamps, complex data types and metadata. An earlier encoding, Sparkplug A, is no longer supported.

State is handled with birth and death certificates. When an edge node connects, it publishes a birth message with all its current metric values. Its death certificate is registered as the MQTT Will Message, so subscribers still receive it if the connection drops without warning. After the birth message, the specification recommends report by exception: publish a value only when it changes. An edge node can also name one primary host application and hold its data until that host is back online.

Sparkplug is maintained by the Eclipse Sparkplug Working Group at the Eclipse Foundation. Version 3.0.0 of the specification is dated November 2022. It makes no normative statements on security; that is left to the MQTT setup, such as TLS and client authentication.

Plain MQTT vs Sparkplug B

Plain MQTTSparkplug B
Topic namesNot defined; each project choosesOne fixed structure that starts with spBv1.0
PayloadNot defined: JSON, binary or anything elseGoogle Protocol Buffers, with typed metrics and timestamps
Device stateA Will Message is available; how to use it is up to youBirth and death certificates for edge nodes, devices and host applications
When data is sentUp to the publisherReport by exception is recommended after the birth message
Maintained byOASISEclipse Sparkplug Working Group

Questions about Sparkplug B

Is Sparkplug B a protocol?

No. It is a specification that runs on top of MQTT. The transport is still MQTT; Sparkplug adds rules for topic names, payload encoding and session state.

What is the difference between Sparkplug A and Sparkplug B?

They are two payload encodings. Sparkplug B came shortly after A and added metric timestamps, complex data types and metadata. The specification says Sparkplug A is no longer supported.

What does spBv1.0 mean?

It is the first element of every Sparkplug B topic. "sp" identifies Sparkplug, "B" is the payload encoding scheme, and "v1.0" is the version of that scheme.

Related terms

Monday digest

See these terms in the news, weekly.

8 to 12 sourced items · every Monday morning · free