The MQTT transport mapping for version 3.1.1 only supports the connection property ClientID using a KeyValuePair. Any other configured setting in the connection properties shall be silently discarded.

If the ClientID is not configured, the PublisherId is used as ClientID. If the PublisherId has a UInteger DataType, the UInteger value is converted to a String for the ClientID.

MQTT version 5.0 allows Publishers and Subscribers to provide MQTT connection properties as part of opening the connection.

The connection properties apply to any connection created as part of the PubSubConnection, or subordinate configuration entities, such as the WriterGroup and the DataSetWriter.

The properties are defined through the KeyValuePair array in the ConnectionProperties. The NamespaceIndex of the QualifiedName in the KeyValuePair shall be 0.

Table 175 formally defines the ConnectionProperties used for MQTT connection configuration.

Table 175 – MQTT ConnectionProperties

Key

DataType

Description

0:MqttVersion

String

Defines the MQTT version to use for the MQTT connection. Possible values are “3.1.1”, “5.0” and “BestAvailable”.

The default value is BestAvailable.

0:MqttTopicPrefix

String

The <Prefix> part of the Topic convention defined in 7.3.5.7.1.

The default value is “opcua”

For MQTT properties, the Name of the QualifiedName is constructed from a prefix “connection” followed by a hyphen and the MQTT property name with the following syntax.

Name = connection-<MQTT property name>

Table 176 defines the MQTT standard connection properties.

Table 176 – OPC UA MQTT standard connection property configuration

MQTT property name

OPC UA DataTypes

MQTT data types

ClientID

String

UTF-8 Encoded String

Receive Maximum

UInt16

Two Byte Integer

Maximum Packet Size

UInt32

Four Byte Integer

Session Expiry Interval

UInt32

Four Byte Integer

Topic Alias Maximum

UInt16

Two Byte Integer

Request Response Information

Boolean

Byte

Request Problem Information

Boolean

Byte

Any name not in the Table 176 is assumed to be a MQTT User Property.

When a field is added to the header as a MQTT User Property the value is encoded as UTF-8 encoded String. If the value is not a String, then it is encoded using the non-reversible OPC UA JSON Data Encoding rules in OPC 10000-6.