MQTT operation
Supported operations
The MQTT operation defines the action to perform with the MQTT broker, using the details from the MQTT connection. The operation supports these actions:
- Listen - Used to subscribe for messages from the MQTT broker.
- Send - Used to publish messages to MQTT brokers.
Options tab
Topic - MQTT publishes messages as topics. Topic naming conventions and limitations are:
-
Uses forward slashes
-
Has at least 1 character
-
Is case-sensitive
-
Supports the single-level wildcard + (sensors/+/temperature) (Listen operation only)
-
Supports the multi-level wildcard # (sensors/smoke alarms/#) (Listen operation only)
-
MQTT message size can be a maximum of 1MB. This limit can be overridden by setting a higher value via the container property. To learn more, refer to the Maximum Size for Update Operation.
Quality of Service - MQTT defines three levels of quality of service where 0 is the lowest and each higher level designates a higher level of effort by the broker to ensure more reliable message delivery.
Select a value from the dropdown to set the quality of service:
-
0 - At most once delivery. This is the fastest way to send a message using MQTT because MQTT does not expect a response and does not define retry semantics. A QoS 0 message can get lost if the client unexpectedly disconnects or if the broker fails. This default is used unless you override it.
-
1 - At least once delivery. The MQTT client or broker attempts to deliver the message at least once but may deliver duplicate messages.
-
2 - Exactly once delivery. The message is delivered once and only once. Duplicate messages are not delivered to the receiving application.
Retain Message - A retained message is the last known good value - that is the last message with the retained flag set to true. When a new client submits a subscription for a topic that has already been sent, any retained messages can be sent to that new client using the retain message option. This feature is useful for newly-connected components or devices to get status updates and when opening a new subscription, as you do not need to wait for the interval update.
Sets the retain message flag, which is cleared by default. If selected, the MQTT broker stores the last retained message and the corresponding Quality of Service for that topic.
Archiving tab
Refer to the topic Connector operation’s Archiving tab for more information.
Tracking tab
Refer to the topic Connector operation’s Tracking tab for more information.
Tracked properties
- Topic - MQTT messages are published in topics. This property tracks the value entered in the Topic field in the Operation tab.
Caching tab
Refer to the topic Connector operation’s Caching tab for more information.
Listener status
The Listen operation reports its connection status in real time, so you can monitor listener health from the Listeners page in the platform. Each running instance of the listener independently reports one of the following statuses:
- Listening — the listener started successfully and is actively consuming messages from the queue.
- Degraded — the listener was previously connected, but lost its connection to the broker, or the broker cancelled the consumer (for example, if the queue it was consuming from was deleted). The connector automatically attempts to recover the connection.
- Errored — the listener failed to start, for example due to an unreachable broker, invalid credentials, or a missing queue/exchange. An errored listener does not retry on its own — correct the underlying issue, then restart or redeploy the listener. When a listener is in a Degraded or Errored state, select View Error Message on the Listeners page to see the specific error and stack trace reported by the connector, so you can identify the root cause.
This status reporting is automatic. It requires no additional configuration and does not change how messages are consumed, acknowledged, or routed to the Dead Letter Queue.