The Broker connector is the primary MQTT publish/subscribe connector - it auto-publishes tag changes across all other connectors to the broker (topic-per-tag), handles inbound command topics that map to local tags, and supports TLS in addition to plain TCP. Like the generic MQTT connector, it has no polling loop of its own - all of its periodic work (connection monitoring, reconnection, and the heartbeat) runs inside a single dedicated background loop.
The connector detects when the broker connection is lost and reconnects automatically without blocking - reconnection runs on its own dedicated background thread, and an explicit disconnect is issued before every reconnect attempt to avoid MQTTnet's own "not allowed to connect while connect/disconnect is pending" race.
| Name | Values | Description |
|---|---|---|
| Type | BROKER | The connector type identifier. |
| Address | IP address or hostname | The MQTT broker's address. |
| Port | integer | The broker's MQTT port. |
| ClientId | string | The MQTT client identifier to connect with. |
| Username / Password | string | Broker credentials, if required. |
| Certificate / CaCert / CertPassword | file path / string | Client certificate, CA certificate, and certificate password for a TLS connection. |
| Version | MQTT protocol version | The MQTT protocol version to connect with (e.g. v3.1.1 or v5.0.0). |
| QOS | 0, 1, or 2 | The default Quality of Service level for publishes. |
| Retain | true/false | Whether published messages are retained by the broker. Defaults to true unless explicitly set to false. |
| Persistent | true/false | Whether to request a persistent (non-clean) session from the broker. |
| Indented | true/false | Whether published JSON payloads are pretty-printed. Defaults to true unless explicitly set to false. |
Every MQTT payload is plain text, so there's no DataType disambiguation needed - the raw payload string is passed straight to each tag's own SetValue, and the tag type itself (BoolTag/IntTag/DecimalTag/StringTag/etc.) handles its own coercion.
| Tag Type | Address | Behaviour |
|---|---|---|
| Any standard tag | An MQTT topic, matched case-insensitively | Subscribed on connect; updated whenever a message arrives on that topic. |
| Name | Arguments | Description |
|---|---|---|
| PublishTag | Tag, Payload | Publishes a specific tag's current value/payload to its topic on demand. |
| Redirect | (arbitrary command payload) | Publishes an arbitrary command payload to the engine's redirect topic, for cross-instance command routing. |
| Monitor | Name, Payload | Publishes program/monitor data for a named item, e.g. for debug tooling. |
| ResetTag | Name, Value | Sets a tag's value directly, without going through MQTT. |
The Address field of a tag is the literal MQTT topic to subscribe to. Command-style writes (PublishTag/Redirect/Monitor) are only available via RunMethod rather than through a polled tag.