Skip to main content Skip to footer

MQTT Sub Broker Documentation

Version: 3.1.0

Retrieved: 2025-10-09 15:16:05


MQTT Subscriber

The module is used to subscribe to MQTT messages that are sent to the Crosser server from connected MQTT clients. This module will subscribe to messages by using the topic in the Settings. You can also send message to this module by using the MQTT publisher module from another flow.

This module is designed to be located at the start of a flow.

Settings

Name Requirements Purpose Default
Topic Length: 1-256 Match Topic against the topic of incoming MQTT messages ""
Target Property Length: 1-64 The property to write the payload into "data"
Output Format Raw (no formatting) or JSON Will convert the data property on the input to an object from the specified format Json

The Topicsetting accepts wildcards:

+ is single-level

# is multi-level

Settings Example:

Setting.Topic MQTT.Topic Match
foo/bar foo/bar true
foo/+/baz foo/bar/baz true
foo/+/bar/baz foo/bar/baz false
foo/bar/# foo false
foo/bar/# foo/bar/baz/boo true

Input

The input is a MQTT message described in the table below. The only mandatory properties are topic and data, the rest could in theory be omitted, and others could in theory be added.

Name Required Type Description
topic yes string The topic of the MQTT message
data yes byte[] The actual payload of the MQTT message.
qos no int The quality of service level for the message
retain no bool The flag for storing the message (aka store the last known good value)
dupFlag no bool The flag for knowing if the message was sent more than once.

Output

The output from the MQTT Sub Broker is always the same as the input but data will be placed on the Target Property default ('data'). So the output is listed in the table above. Note that Output Format in the settings will affect the data property.

Example output

{
  "crosser": {
    "success": true
  },
  "data": [
    {
      "pressure": 420,
      "temp": 32
    },
    {
      "pressure": 487,
      "temp": 78
    },
    {
      "pressure": 317,
      "temp": 79
    }
  ],
  "dupFlag": false,
  "qos": 0,
  "retain": false,
  "topic": "array"
}