The MQTT transport mapping for version 3.1.1 does only support the connection property ClientID using a KeyValuePair. Any other configured setting in the connection properties shall be silently discarded.
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. 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 166 defines the MQTT standard connection properties.
Table 166 – 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 166 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.