MQTT Subscriber Trigger

The MQTT Subscriber Trigger subscribes to a topic and presents the messages received as output. When the messages arrive, a new flow is triggered.

Configuration

The Configuration tab has the following fields:

Field Description
Connection Name of the connection
Topic The topic to which the trigger subscribes.
Note: As the topic string can contain wild card characters, multiple topics can be subscribed.

Some topic string rules are:

  • + is a single level wild card. It must be presented alone between '/' chars
  • # is a multi-level wild card corresponding to one or more levels. It must be presented as the last char in the topic preceded by a '/'. The following topic strings are allowed:
    • /country/province/county/street
    • /country/+/county/street
    • /country/province/#
    • /country/+/county/#

    For details about topic string rules, see the MQTT documentation.

Maximum QoS

If a message is sent with a higher QoS, the effective QoS of the message is reduced to the maximum QoS value. To avoid QoS getting reduced on the subscriber side, you must set maximum QoS to 2.

Value Deserializer Establish the way the message body is treated
Value Deserializer:String The activity input presents the message bytes as a simple string
Value Deserializer:JSON The activity input presents the message bytes as a JSON object decoded with the provided schema
Value Deserializer:Base64 The activity input presents the message bytes as a base64 encoded string

Output Settings

The Output Settings tab has the following field:

Field Description
Schema for JSON value Enter a JSON object representation used on the output tab.

For instance:

{

"fname":"Sam",

"lname":"Patricks",

"age":37,

"employed":true

}

Output

The Output tab displays the schema in a tree format. The output is read-only.

The Output tab has the following fields:

Field Description
topic The exact topic on which the message arrived
retained It indicates whether this message was a retained message
qos It indicates the quality of service of the message.
string value The value of the message presented as a string. An error is displayed if the message is not a string.