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. The MQTT Subscriber Trigger supports multiple trigger handlers. A single MQTT Subscriber trigger listens to multiple topics and in turn executes multiple flows.

Settings

The Settings tab has the following fields:

Field Description
Trigger Settings The trigger settings are common to the trigger across all flows that use the trigger.
Handler Settings The handler settings are applicable to a specific flow attached to the trigger.
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. The QoS reported on the output schema of the trigger is a copy of this setting and not the QoS established by the publisher.

Value Deserializer Establish the way the message body is treated
Note: Messages received by the subscriber must conform to the value deseriaization scheme configured for the subscriber. An error occurs if the subscriber receives a message that does not conform to the configured deserialization scheme and schema.
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
Show Will Fields When set to true, you can use Show Will Fields to view the last will and testament fields. When Show Will Fields is set to true, it populates the following fields:
  • Will: Enter the message to be sent to the WillTopic when the connection terminates abnormally.
  • Will Topic: Enter a topic to which the Will message is sent when there is a connection failure.
  • Will QoS: Quality of Service for the Will message. Valid values are as follows:

    0: Message is delivered at most once

    1: Message is delivered at least once

    2: Message is delivered exactly once

  • Will Retain: Set to true to allow the server to retain the Will message.

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.
duplicate It is set to true when the message is received, but not acknowledged. The message is then re-received. This happens in the event of a subscriber failure or uncontrolled application shutdown.
messageID It is a sequential integer enumerating all the messages processed by the subscriber because it is instantiated.
string value The value of the message presented as a string. An error is displayed if the message is not a string.