Skip to main content
Version: 5.6

MQTT Plug-in Configuration

This page describes the configuration of the MQTT broker connection. The actual message processing is then handled by the MQTT Transfer Object, MQTT Subscribe, or the MQTT Storage Read Transfer Object.

Overview

The MQTT plug-in provides the connection to the broker. If you want to receive MQTT messages and trigger connections with them, you must also use MQTT Subscribe. To publish messages, use the MQTT Transfer Object.

Legacy / Migration

Up to version 5.4, the MQTT implementation could be selected in the Expert Settings → Implementation section. The following options were available:

  • Legacy Automatic
  • Legacy Strider Mqtt
  • Legacy MQTTnet
  • MQTTnet (recommended)

Starting with version 5.5, a migration notice is displayed for old configurations, recommending a switch to MQTT .NET V2.

Starting with version 5.6, only MQTT .NET V2 is available.

MQTT plugin, Router configuration tab


Router settings

FieldDescription
NameAssign a unique name to the MQTT connection.
Cloud ProfileSelect the desired profile: MQTT Standard, AWS, Azure IoT, Wago Cloud.

You can check the current connection using Test Connection.

Cloud Profiles

The cloud profiles extend the standard configuration with additional tabs:

tip

For more information on using MQTT and the cloud profiles, see our knowledge base:

https://www.opc-router.de/knowledge-base/


Connection Options

MQTT Plug-in, Connection Options

Connection Details

FieldDescription
Broker ConnectionEnter the address of the MQTT broker. The screenshot shows my.broker.com as an example.
PortTCP port of the broker. When Enable TLS/SSL is activated, 8883 is typically preset; without TLS/SSL, 1883 is usually used.
MQTT VersionSelection of the protocol version. In the screenshot, MQTT 3.1.1 is selected as an example.
Quality of Service TypeSelection of the standard QoS: 0 – at most once, 1 – at least once, or 2 – exactly once.
Performance

For details on latency, network round trips (RTT), and internal synchronization during publish operations, see MQTT Performance.

Authentication

FieldDescription
UsernameUsername for logging in to the broker.
PasswordSelection of a secret. Use the buttons to create, edit, or delete a secret.
Client IDUnique client ID. Supports the placeholders ${hostname}, ${hostname:lower}, #[INSTANCE], #[INSTANCE:<numerischer wert="">], and #[RAND:<numerischer wert="">]. This allows you to automatically generate different IDs per instance during connection pooling or project synchronization. A preview of the generated client ID is displayed below the input field.
ButtonsRandom generates a random ID. Client ID Template inserts the default template into the input field.

Enable TLS/SSL

FieldDescription
Enable TLS/SSLEnables the encrypted connection to the broker. If this option is enabled, the TLS/SSL settings are displayed below.
SSL ProtocolsSelection of supported protocols, for example TLSv1, TLSv1.1, TLSv1.2, or TLSv1.3. Multiple protocols can be enabled.
Client CertificateSelection of a client certificate for logging in to the broker. Use the buttons to remove, add, view, or delete certificates.
Trusted CertificatesSpecify which certificates are accepted, for example Router, Windows, or All (unsafe).

Storage

FieldDescription
Enable MQTT Data StorageWhen enabled, the last received MQTT message for each topic is saved to disk. This feature is required to use the MQTT Storage Read Transfer Object.
PatternA subscription is created for each added topic pattern. Supports the wildcards + and #.
NoteFree text describing the purpose or origin of a topic.
How it works

When the MQTT Data Storage function is enabled, the OPC Router creates automatic subscriptions for all registered topics. The received messages are stored persistently, but only the latest message per topic is retained. Older values are overwritten.

These stored values can be specifically retrieved using the MQTT Storage Read transfer object.


First Will

FieldDescription
Enable First WillEnables the sending of a First Will when establishing a connection.
Retain First WillBroker stores message for later delivery.
TopicTarget topic for the First Will.
PayloadContent of the First Will message.
Quality of ServiceService quality (0, 1 or 2).

Last Will

FieldDescription
Enable Last WillEnables sending a message if the connection is lost.
Retain Last WillBroker saves message for later delivery.
Send Last Will on Connection LossSends Last Will even upon manual disconnection.
TopicTarget topic for the Last Will.
PayloadContent of the Last Will message.
Quality of ServiceService quality (0, 1, or 2).

Advanced

Connection Pool

FieldDescription
Enable Connection PoolWhen enabled, a single connection is used for subscriptions and multiple connections for publish operations. Useful for high message volumes.
Min. ConnectionsMinimum number of connections.
Max. ConnectionsMaximum number of connections.
Timeout LimitTime in minutes after which inactive connections are closed.

Subscription / Trigger

FieldDescription
Wait for TransferThe router responds to the broker only after the transfer has completed or failed.
Enable Message DeduplicationPrevents multiple triggers for identical messages within a time window.
Time Window for DeduplicationTime in seconds during which identical messages are ignored.

Session Options

FieldDescription
CleanSessionStarts a new session without saved messages (disable for persistent sessions).
Keep alive (s)Ping interval in seconds.
Timeout (ms)Wait time in milliseconds for reconnection.
tip

Use the MQTT Performance page if you want to optimize QoS, RTT, or connection pooling for throughput and latency.