MQTT Connector: Configuration
To provide the required information for the subscriber, a configuration file with the extension *.mqtt
is required, which is loaded when the server is started.
The configuration file is located at the main level of the project and is loaded when the server is started.
The values for clientId
, cleanSession
and timeout
can also be set via adapter parameters.
If not all parameters are set via the adapter parameters, the values from *.mqtt
are used.
How to create the configuration file
Right-click on the name of the project in the Projects view.
A dialog window opens.Select New >
.mqtt
. The configuration file with the extension.mqtt
has now been created at the main level of the project.
The file has the following structure:
<?xml version="1.0" encoding="UTF-8"?>
<MqttConfiguration>
<threadPoolSize>10</threadPoolSize>
<broker server = "tcp://localhost:1883">
<client id="1" active="true" cleanSession="false" timeout="30" automaticReconnect="true">
<topic filter="topic1" qos="AT_LEAST_ONCE"></topic>
<process url="Processes/data.wrf"></process>
</client>
</broker>
</MqttConfiguration>
The following attributes and elements are contained in the configuration file:
Element / Attribute | Description |
---|---|
| Root element of the configuration file |
| Number of usable threads Possible values: Integer |
| Host and port of the broker Possible values: Host and port of the broker, separated by a semicolon |
| Unique client ID with the following attributes:
|
| Topic that can be subscribed to in order to receive the published message. It has the following attributes:
|
| A quality of service (QOS) can be set for topics. There are three possible QOS. This can be set in the configuration file as follows:
|
| Specifies the process in which the received data is to be used. The received data is written to the process as XML. Possible values: Path to the process Example:
|