---
title: What is the Primary Host ID functionality of the MQTT Sparkplug Spec?
description: MQTT Sparkplug B specification provides for a Primary Host ID.  This post explores that functionality and explains how to use it alongside the Canary MQTT Data Collector.
image: https://blog.canarylabs.com/hubfs/SparkplugB-1.png
---

[![](https://canarylabs.com/images/CanaryLabs_Logo.svg)](https://canarylabs.com)

[partners](https://canarylabs.com/partners) [pricing](https://canarylabs.com/pricing) [SUPPORT](https://canarylabs.com/support) [Help Center](https://helpcenter.canarylabs.com/) [Try Canary](https://canarylabs.com/try-canary)

# What is the Primary Host ID functionality of the MQTT Sparkplug Spec?

Following a meeting with an end user and a question regarding MQTT Primary Host ID, I decided to write up a brief summary on the Sparkplug B Primary Host ID.

Share this article <https://www.facebook.com/sharer/sharer.php?u=https://blog.canarylabs.com/what-is-the-primary-host-id-functionality-of-the-mqtt-sparkplug-spec> <https://www.linkedin.com/shareArticle?mini=true&url=https://blog.canarylabs.com/what-is-the-primary-host-id-functionality-of-the-mqtt-sparkplug-spec> <https://twitter.com/intent/tweet?original_referer=https://blog.canarylabs.com/what-is-the-primary-host-id-functionality-of-the-mqtt-sparkplug-spec&url=https://blog.canarylabs.com/what-is-the-primary-host-id-functionality-of-the-mqtt-sparkplug-spec&text=What%20is%20the%20Primary%20Host%20ID%20functionality%20of%20the%20MQTT%20Sparkplug%20Spec>

 Feb 10, 2020

![](https://blog.canarylabs.com/hubfs/SparkplugB-1.png)

Following a meeting with an end user and a question regarding MQTT Primary Host ID, I decided to write up a brief summary on the Sparkplug B Primary Host ID.

The MQTT Sparkplug B specification defines a way for subscribing clients (like our Canary Collector) to notify publishing clients (Cirrus Link's Ignition Transmission Module or PLCs) when they are online or offline. The publishing clients can then key off of a particular subscriber’s status to do different things when the subscriber’s status changes either online or offline.

One example would be that the disconnection of a SCADA system could trigger the devices to stop transmitting any data as there may not be a need for any data to be published if the SCADA system is not online.

Cirrus Link's MQTT Transmission Module for Ignition keys off of a Primary Host ID to enable the store and forward of tag changes within the module. Our Canary Collector can be enabled to take advantage of this functionality utilizing two configuration settings in the Canary MQTT Collector database.

The first is the *MQTTClientId* field. This field is used to identify the Canary Collector within the MQTT broker. The second is the *IsPrimaryApplication* setting. The Cirrus Link Transmission Module for Ignition is then configured to look for the ‘Canary’ Primary Host ID. If this setting is true, the Canary Collector will identify itself as the primary SCADA application in the MQTT broker and when the Canary Collector is shutdown or becomes disconnected from the broker, the MQTT Transmission Module will detect the offline state of the collector and begin to store data changes.

Then when the Canary Collector reconnects to the broker, the Transmission Module will flush the tag changes to the Canary Collector.

This feature is currently being used at several large upstream oil and gas companies to prevent data loss if the MQTT Collector is shut down.

### Get Canary Updates in Your Inbox

![canarybird](https://blog.canarylabs.com/hubfs/canarybird.svg)

### The Data Historian for Industrial Automation

With only 3 steps, we make maximizing the value of your process data simple.

[![LEARN MORE](https://no-cache.hubspot.com/cta/default/2335443/c4a82749-1d85-4939-b380-effb27086b97.png)](https://cta-redirect.hubspot.com/cta/redirect/2335443/c4a82749-1d85-4939-b380-effb27086b97)

### Make It Easy To Use Your Time-Series Data

[![TRY CANARY](https://no-cache.hubspot.com/cta/default/2335443/d51dbc32-fedb-415c-963a-aeaac2348a0d.png)](https://cta-redirect.hubspot.com/cta/redirect/2335443/d51dbc32-fedb-415c-963a-aeaac2348a0d)

### Popular Post

###### [Enterprise Data Historian Pricing Comparison for AVEVA PI, Ignition, and Canary Data historians are key to an organization understanding their process, but](https://blog.canarylabs.com/canary-ignition-and-osisoft-pi-pricing-comparison)

###### [A Guide to the Best Enterprise Data Historian Software: A Review of the Canary Historian Versus Rockwell FactoryTalk or AVEVA PI When a company decides to make a capital investment in data historian softw](https://blog.canarylabs.com/2016/06/27/a-guide-to-the-best-data-historian-software-a-review-of-the-canary-historian-versus-rockwell-factorytalk-and-osisoft-pi)

###### [The Difference Between Historians...Data, Process, Site, Enterprise and Cloud If you have spent any time researching industrial databases, you have likel](https://blog.canarylabs.com/the-difference-between-historians...data-process-site-enterprise-and-cloud)

### Popular Categories

- [Ask Gary (1)](https://blog.canarylabs.com/tag/ask-gary)
- [Canary Collectors (2)](https://blog.canarylabs.com/tag/canary-collectors)
- [Canary Historian (3)](https://blog.canarylabs.com/tag/canary-historian)
- [Case Studies (1)](https://blog.canarylabs.com/tag/case-studies)
- [Data Historian (5)](https://blog.canarylabs.com/tag/data-historian)
- [feature (2)](https://blog.canarylabs.com/tag/feature)
- [industry 4.0 (1)](https://blog.canarylabs.com/tag/industry-4-0)
- [Products (1)](https://blog.canarylabs.com/tag/products)
- [Trending Software (2)](https://blog.canarylabs.com/tag/trending-software)

See all

### Most companies are spending too much money on their data historians

[![VIEW PRICING](https://no-cache.hubspot.com/cta/default/2335443/240863ce-2fc8-471a-9180-b2ec33e53259.png)](https://cta-redirect.hubspot.com/cta/redirect/2335443/240863ce-2fc8-471a-9180-b2ec33e53259)

![](https://canarylabs.com/images/CanaryLabs_Logo.svg)

#### About

Founded in 1985 with a focus to develop solutions from the end user’s perspective, we have achieved more than 20,000 installations in over 70 countries. Our clients represent private, public, and government entities in all major industries.

#### Contact

195 Bean Hill Road  
The Brownstone Building  
Martinsburg, PA 16662

814.793.3770

#### Main menu

- [Home](https://canarylabs.com/)
- [Product Tour](https://canarylabs.com/product)
- [Pricing](https://canarylabs.com/pricing)
- [Partners](https://canarylabs.com/partners)
- [Ignition Module](https://canarylabs.com/ignition-module)
- [Higher Education](https://canarylabs.com/canary-for-higher-education)
- [Support](https://canarylabs.com/support)
- [Try Canary](https://canarylabs.com/try-canary)

#### Company menu

- [About](https://canarylabs.com/about)
- [Blog](https://blog.canarylabs.com)
- [Contact](https://canarylabs.com/contact)
- [Export Policy](https://canarylabs.com/export)
- [Careers](https://canarylabs.com/careers)

#### the canary system

[**1. Collect & Store Your Data**](https://canarylabs.com/product/part-1)

- [Historian](https://canarylabs.com/product/historian)
- [Data Collectors](https://canarylabs.com/product/data-collectors)
- [Store & Forward](https://canarylabs.com/product/store-and-forward)

[**2. Apply Context to Your Data**](https://canarylabs.com/product/part-2)

- [Virtual Views](https://canarylabs.com/product/virtual-views)
- [Calculation Server](https://canarylabs.com/product/calculation-server)
- [Events](https://canarylabs.com/product/events)

[**3. Maximize Your Operation**](https://canarylabs.com/product/part-3)

- [Axiom](https://canarylabs.com/product/axiom)
- [Excel Add-In](https://canarylabs.com/product/excel-add-in)
- [Data Connectors](https://canarylabs.com/product/data-connectors)

```json
{
  "@context" : "https://schema.org",
  "@type" : "VideoObject",
  "caption" : {
    "@type" : "MediaObject",
    "contentUrl" : "https://blog.canarylabs.com/media-transcripts/24712171235/en.vtt",
    "inLanguage" : "en",
    "name" : "en Captions"
  },
  "contentUrl" : "https://stream.mux.com/vz00pQuYGAV302ydwc00CJGHjCNmE9caOl02uSWKIT9ROoU/capped-1080p.mp4",
  "dateModified" : "2025-10-06T18:18:33.085Z",
  "duration" : "PT6M14S",
  "height" : 1080,
  "name" : "Whiteboard Explainer",
  "thumbnailUrl" : "https://2335443.fs1.hubspotusercontent-na1.net/hubfs/2335443/Whiteboard%20Explainer.mp4/medium.jpg?t=1759774713085",
  "uploadDate" : "2020-01-22T18:59:17.137Z",
  "width" : 1920
}
```