Skip to main content

Connhex Message Policy (CMP)

The Connhex Message Policy (CMP) describes a way for connectables to send messages.

What is it and why should I care?

You can see it as an abstraction over base message formats, with the main goal of routing messages based on what type of information is carried. If the connectable-to-cloud communication correctly implements CMP, Connhex Core will automatically route messages to dedicated tables, ensuring faster data retrieval and storage costs minimization.

Components

There are three types of messages: infos, params and data.

TypeIDFormatNotes
Infos"infos"JSONContains information that describes a connectable (e.g. serial, firmware version, ...). It consists of information that either can't be edited or doesn't change at runtime.
Params"params"SenMLContains all the connectable's configuration parameters (e.g. current operating mode, ...): these can be edited at runtime.
Data"data"SenMLContains any time series collected by the connectable during its operation (e.g. temperature, pressure, ...).

To tag a payload according to this classification, the connectable only needs to specify the corresponding ID as the last segment of the target path 1:

channels/<chan_id>/messages/events/<ID>

If ID is not specified, all routing will default to data.

Transmission rate

The majority of use cases see data as the most frequent message, followed by params and infos. Use the table below as an additional tool to map your messages into these three types.

TypeFrequency
InfosAt every connectable boot/reboot, after a firmware update, ...
ParamsAny time one or more parameters are updated, after a network loss event (if any parameters have changed), ...
DataAny time new data is collected, or at regular intervals.

  1. Topic if the connectable uses MQTT, URL for HTTP, ...