Introduction of MQTT Data Collector

About MQTT Data Collector

The Historian Message Queue Telemetry Transport (MQTT) Collector connects to MQTT broker and subscribes to a topic. The data should be in Predix time series data format. It automatically adds tags to Historian database and streams the data to Historian Server or Predix Time Series. This collector supports a distributed model, that is, the MQTT broker, the Collector, and Historian are installed on different machines and the data is sent to a remote Historian server. You can also install message broker, collector and Historian in same machine.

MQTT collector with secure data transfer

Note: MQTT collector has been validated with Predix Edge Broker, HiveMQ(v4.2.1), Mosquitto(v1.5.8).

Transport Layer Security (TLS) authentication is used for subscribing the data from message broker to avoid middleware attacks so that the data is securely transferred from message broker to the MQTT collector.

The collector expects the data in Predix time series format as mentioned below and converts it into Historian understandable format. It verifies whether the tag is available in the Historian, if not it will add the tag and then add the data samples.

{"body":[{"attributes":{"machine_type":"opcua"},"datapoints":[[1558110998983,9547909,3]],"name":"QuadInteger"}],"messageId":"flex-pipe"}

The following table outlines json format structure.

Json fieldDescriptionMandatory/Optional
Machine typeSource machine nameOptional
Datapoints

Time, value and quality (Time in epoch format)

Mandatory
NameTag nameMandatory
MessageIdType of messageOptional
Note: For the fields marked optional, you need not enter values. However, you must enter the fields. For example:
{"body":[{"attributes":{"machine_type":" "},"datapoints":[[1558110998983,9547909,3]],"name":"QuadInteger"}],"messageId":" "}