The MQTT plugin allows sending the collected messages via MQTT and MQTT over websockets to a remote system. Proxy-support is on board as well as local message caching/persisting and data compression.
Two settings are mandatory for running the MQTT-plugin and connecting to the Senseforce MQTT broker. All the other settings are for advanced use-cases (see the section below).
Enter the username and password for connecting with the remote broker. Contact Senseforce for getting your credentials.
The topic identifies your machine in the Senseforce cloud. The following format is required: tenant/machineIdentifier. If your company is called MyCompany at Senseforce and your machine is called Machine1, use the following topic: MyCompany/Machine1
The topic setting identifies the data sent to the Senseforce cloud and correlates them to a specific machine identifier. Renaming a machine identifier is not possible.
A sample MQTT plugin configuration is illustrated below
<?xml version="1.0" encoding="utf-8" ?>
xsi:schemaLocation="https://senseforce.io/ ..\..\Schemas\mqttnetsettings.xsd" >
<!-- Allowed settings for ProtocolVersion: NONE, Version_3_1_0, Version_3_1_1 (default), Version_5_0_0-->
<!-- Allowed settings for TlsVersion: NONE, SSL3, TLS_1_0, TLS_1_1, TLS_1_2-->
<!-- by default tcp mqtt server is used. Set UseWebsockets to true, to enable communication via websockets-->
<!-- Use the Host-setting above to give the fully qualified websocket address (like luna.senseforce.io:443/mqtt). The Port-setting is ignored for websockets.
Define the port directly in the Host-entry.-->
<Domain></Domain> <!-- Proxy server domain -->
<Username></Username> <!-- Proxy server user name -->
<Password></Password> <!-- Proxy server password -->
<!--Currently implemented: LZ4, Disabled-->
<!--Messages arriving from ingress plugins are batched until the NumberOfMessagesToCombine is reached or the MessageCombineCounterMs are elapsed. Then they are sent.-->
<!-- If EnableServerCertAuth is set to false, all server certificates are trusted-->
<!-- Set to true, if the oldest message should be deleted in case of the MaxReconnectBuffer is hit. Otherwise, the newest incoming messages are removed -->
<!-- Maximum and minimum reconnect time. A random time interval between these two values is waited after a connection loss to wait for reconnect.-->
The following settings are available: (Note: the corresponding line in the above sample file is provided in brackets).
Define the MQTT broker endpoint address. If using websockets (Setting UseWebsockets = true), the fully qualified websocket address needs to be entered (eg. luna.senseforce.io:443/mqtt). Otherwise, only the hostname is required (eg. luna.senseforce.io)
Senseforce default: luna.senseforce.io
Port of the remote broker. Make sure, your firewall supports outgoing connections on this port.
Senseforce default: 8883 (also available: 443)
If set to true, a TLS-encrypted connection is used. To connect with Senseforce, this setting needs to be true
Determines, whether anonymous clients (without username and password) can connect to the remote broker. Not allowed when connecting to Senseforce
Specify the MQTT protocol version. Allowed settings are: NONE, Version_3_1_0, Version_3_1_1 (default), Version_5_0_0
Defines the TLS-Version to use. Allowed settings are: NONE, SSL3, TLS_1_0, TLS_1_1, TLS_1_2
Allows enabling MQTT over websockets, enabling to communicate the messages over websocket technology. This setting might be advantageous to circumvent strict firewall rules, as this kind of traffic is often allowed. Furthermore, websockets allow enabling Proxy-Support (see below). Use the Host-setting to give the fully qualified websocket address (like luna.senseforce.io:443/mqtt). The Port-setting is ignored for websockets. Define the port directly in the Host-entry.
Definition of a proxy-server. Define proxy server address, optional domain, username, and password.
Allows enabling LZ4 compression. Alternatively, DISABLE the compression. If compression is enabled, the topic is automatically extended as follows: [topic]/LZ4
Messages arriving from ingress plugins are batched until the NumberOfMessagesToCombine is reached or the MessageCombineCounterMs (milliseconds) are elapsed. Then they are sent. Setting higher values reduces bandwidth if the transmitted messages are compressed.
Specify whether and where to persist incoming messages on the file system. Highly suggested as this setting allows to overcome extensive periods without being connected to the internet and without losing messages.
Define if the MQTT plugin should verify the remote server certificate. It is highly suggested to activate this setting to prevent from connecting to unknown servers.
CaFilePath specifies where to find the certificate which was used to sign the remote server certificate (and therefore is used for the verification process)
Set this setting to true to remove the oldest message from the internal message queue if it is full. If set to false, the newest incoming messages are dropped.
Defines the size of the internal message queue - how many messages can be locally stored while not connected to the remote server.
Maximum and minimum reconnection time. A random time interval between these two values is waited after a connection loss to wait for reconnecting.