Contents
Cirrus Link Resources
Cirrus Link Website
Contact Us (Sales/Support)
Inductive Resources
Ignition User Manual
Knowledge Base Articles
Inductive University
Forum
Sparkplug B Payload Compression
Some Sparkplug libraries contain utilities and helpers for doing compression and
decompression of Sparkplug B payloads. Alternatively this compress and decompression can
be done by any code or application.
Here are the steps required to apply compression to a Sparkplug B payload before publishing
it to an MQTT Server.
{
"timestamp" : 1486144502122,
"seq" : 0,
"body" : <compressed-encoded-payload>
}
Example: Payload compression with DEFLATE algorithm
{
"timestamp" : 1486144502122,
"seq" : 0,
"body" : <compressed-encoded-payload>
"metrics" : [ {
"name" : "algorithm",
"dataType" : "String",
"value" : "DEFLATE"
} ]
}
Example: Payload compression with GZIP algorithm
{
"timestamp" : 1486144502122,
"seq" : 0,
"body" : <compressed-encoded-payload>
"metrics" : [ {
"name" : "algorithm",
"dataType" : "String",
"value" : "GZIP"
} ]
}
5) Finally, encode the new payload using Google Protocol Buffers and it is ready to be published.