MQTT - v5 Generic
The MQTT - v5 Generic connector enables Litmus Edge (LE) to connect to an MQTT v5 broker. Set Connection Type to tcp for an unencrypted connection, or to ssl for a TLS-encrypted connection.
Supported versions
Compatible with MQTT protocol versions 3.1.0, 3.1.1, and 5.0.0.
Supported communication
- Outbound (publish data from LE to the MQTT broker): Yes
- Inbound (subscribe to data from the MQTT broker to LE): Yes
Configurations
Note: When you add an outbound topic for this connector, a Retain option is available. When enabled, the broker retains the last published message on that topic, so new subscribers receive it immediately when they connect. Inbound topics have No Local, Retain as Published, and Retain Handling options. See Add Topics to Connectors for details.
Variable | Detail | Required |
|---|---|---|
Name | Connector name. | Yes |
Connection Type | tcp for an unencrypted connection, or ssl for a TLS-encrypted connection. Default tcp. | Yes |
Hostname | DNS name or IP address of the MQTT broker. The broker must be reachable from the LE system. | Yes |
Port | MQTT broker port. Default 1883. The usual TLS port is 8883. | Yes |
CA Certificate | CA certificate in PEM format, used to verify the broker. You can also install it in the system-wide certificate store. Shown only when Connection Type is ssl. | No |
Certificate | PEM client certificate for mutual TLS authentication with the broker. Shown only when Connection Type is ssl. | No |
Private key | Private key that matches the client certificate. Shown only when Connection Type is ssl. | No |
Insecure Skip Verify | Skip verification of the broker's certificate chain and host name. Use only for testing. Default disabled. Shown only when Connection Type is ssl. | No |
Client ID | Unique client identity. If you leave it empty, LE uses the connector's instance ID. | No |
Username | User name. | No |
Password | User password. | No |
QoS | Quality of Service delivery guarantee: 0 = at most once, 1 = at least once, 2 = exactly once. Default 1. The QoS levels available can depend on the broker configuration. | No |
Integration Topic | MQTT topic that data is published to. Supports dynamic topics. | Yes |
User Properties | Custom key-value metadata attached to outgoing MQTT v5 packets. The broker passes it through to subscribers. | No |
Parallel Publish Count | Number of messages published in parallel. Higher values increase throughput and resource usage. Range 1 to 4000. Default 100. | No |
Response Topic | MQTT v5 topic that the receiver should publish its response to, for request-response messaging. | No |
Payload Format Indicator | Format of the payload in CONNECT and PUBLISH packets: utf-8 or byte. Lets the server understand the packet without reading the payload. Default utf-8. | No |
Content type | MIME type that describes the payload format, such as application/json. Passed to subscribers for information. | No |
Topic Alias Maximum | Maximum number of topic aliases. Topic aliases reduce packet overhead by replacing the topic name with a small integer. Range 1 to 7. Default 7. | No |
LWT topic | MQTT topic the broker publishes the Last Will message to if this client disconnects unexpectedly. | No |
LWT payload | Message content published to the LWT topic on unexpected disconnection. Maximum 255 characters. | No |
LWT payload type | Encoding of the LWT payload: string for plain text, base64 for binary data. Default string. | No |
LWT QoS | QoS level for the Last Will message: 0, 1, or 2. Default 1. | No |
LWT retained | If enabled, the broker retains the Last Will message and delivers it immediately to any new subscriber on that topic. Default disabled. | No |
Will Delay Interval | Delay in seconds between the end of the connection and sending the Last Will message. Range 0 to 60. Default 0. | No |
Session Expiry Interval (seconds) | How long the broker keeps the client's session information. Range 0 to 60. Default 0. | No |
Message Expiry Interval | Expiry interval, in seconds, set on each published message. Default 0. | No |
Request Response Info | Ask the broker to return response information, such as a response topic prefix, in the CONNACK packet. Default disabled. | No |
Request Problem Info | Ask the broker to include reason strings and user properties in error packets, such as PUBACK and SUBACK. Default disabled. | No |
Keep Alive | Keep-alive duration in seconds. The connector sends a packet at least this often, so the connection stays active even when no data is sent. Under MQTT 5.0, if the broker receives nothing within 1.5 times this duration, it closes the connection. Range 1 to 60. Default 60. | No |
Connection Timeout | How long to wait for the connection to complete, in seconds. Range 1 to 60. Default 10. | No |
Throttling limit | Maximum outbound messages per second. If the broker limits the rate of incoming messages, this ensures that no messages are lost. A value of 0 disables throttling. Default 0. | No |
Persistent storage | If enabled, messages in the outbound queue are stored on disk. If there are interruptions in connection or power loss, messages are retained and sent when the connection is restored. Default enabled. | No |
Queue Mode | Order in which buffered messages are sent: fifo (First In First Out) sends the earliest message first, and lifo (Last In First Out) sends the latest message first. Default lifo. Shown only when Persistent storage is enabled. | No |
Persistent storage size limit | Size limit for persisted data, in GB. Default 1. Shown only when Persistent storage is enabled. | No |
Enable Logging | Write connection and publish error messages to the connector log. Logging can increase CPU usage, so enable it only for debugging. Default disabled. | No |
Format directives
Symbol | Definition | Context |
|---|---|---|
$ | A variable follows. A variable represents a dynamic string value. The supported variables are: | - |
$S | Additional Alias definition | from connector settings |
$D | Device Name | from DeviceHub tag |
$N | Tag Name | from DeviceHub tag |
$R | Raw Tag Type | from DeviceHub tag |
$P | Tag Description | from DeviceHub tag |
$H | Hostname | from OS |
% | A function follows. A function acts on the next variable. The supported functions are: | - |
%L | Lowercase() | apply to next variable |
%U | Uppercase() | apply to next variable |
Format directives notes
To use a special character literally, enter it twice: $$ for $, and %% for %.
Example: "$$$D.%%$N" becomes "$deviceABC.%tagXYZ".
Compatibility validation
This information is for reference only. More products and versions may be supported, provided they are compatible with the supported versions listed above.