Skip to main content
Version: Next

MQTT topics

The most visible breaking change introduced by thin-edge.io 1.0 is the new topic structure, which has been made more consistent and extensible with a better support for child devices and services.

Porting an extension that publishes telemetry data on the legacy tedge topic, should not pose any difficulty:

  • measurements and events can be mapped directly to the new scheme by just changing the topics
  • for alarms, the severity in the topic in the old scheme must be mapped to the payload in the new scheme
  • handling of child devices is now consistent for measurements, events and alarms.

Backward compatibility​

The tedge-agent running on the main device implements a compatibility layer and republishes on the new topics any message received on the legacy topics.

Thanks to this compatibility mechanism a legacy extension works out of the box with thin-edge.io 1.0.

However, this mechanism will be deprecated medium-term, and we encourage you to port any legacy extension to the new API.

Telemetry: Main device​

Here is the mapping between the legacy and new topics for the main device:

TypeTopicPayload Changes
Measurements

Legacy

tedge/measurements

New

te/device/main///m/<type>

No Change. If "<type>" is not provided, a default value of "ThinEdgeMeasurement" will be used.

Events

Legacy

tedge/events/<type>

New

te/device/main///e/<type>

No Change

Alarms

Legacy

tedge/alarms/<severity>/<type>

New

te/device/main///a/<type>

The alarm severity should be set in the payload.

{
"severity": "<severity>"
// ...
}
Health status

Legacy

tedge/health/<service_name>

New

te/<service_topic_id>/status/health

type property removed from the payload.

Telemetry: Child device​

Here is the mapping between the legacy and new topics for a child device:

TypeTopicPayload Changes
Measurements

Legacy

tedge/measurements/<child_id>

New

te/device/<child_id>///m/<type>

No Change. If the "<type>" is not provided, a default value of "ThinEdgeMeasurement" will be used.

Events

Legacy

tedge/events/<type>/<child_id>

New

te/device/<child_id>///e/<type>

No Change

Alarms

Legacy

tedge/alarms/<severity>/<type>/<child_id>

New

te/device/<child_id>///a/<type>

The alarm severity should be set in the payload.

{
"severity": "<severity>"
// ...
}
Health status

Legacy

tedge/health/<child_id>/<service_name>

New

te/<service_topic_id>/status/health

type property removed from the payload.