Apama 10.15.0 | Connecting Apama Applications to External Components | Standard Connectivity Plug-ins | The MQTT Transport Connectivity Plug-in | Configuring the connection to MQTT
 
Configuring the connection to MQTT
You configure one or more dynamicChainManagers to connect to different MQTT brokers. For example:
dynamicChainManagers:
mqttManager:
transport: mqttTransport
managerConfig:
brokerURL: tcp://localhost:1883
Connection-related configuration is specified in the managerConfig stanza on the dynamicChainManagers instance. The following configuration options are available for managerConfig:
Configuration option
Description
brokerURL
URL for the MQTT broker.
For example, you can use the following URL for non-TLS connections:
tcp://localhost:1883
To enable SSL/TLS, you simply indicate this in the broker URL. For example:
ssl://localhost:8883
Type: string.
channelPrefix
Prefix for dynamic mapping. If the prefix ends with a colon (:), it needs to be enclosed in quotation marks (see also Using YAML configuration files).
When the channel is mapped to an MQTT topic, the prefix is not used. For example, if the prefix is "mqtt:", then the channel mqtt:test/a maps to the MQTT topic test/a.
Type: string.
Default: "mqtt:".
mqttClientId
Optional. By default, a random client identifier is generated during startup. If you do not want to use this random identifier, you can set this option to configure your own client identifier. This can be any alphanumerical value.
Type: string.
cleanSession
Starts a clean session with the MQTT broker. Set this to false if the previous session is to be resumed. You should only do this in conjunction with setting the mqttClientId.
Type: bool.
Default: true.
acceptUnrecognizedCertificates
Used with TLS. By default, connections to unrecognized certificates are terminated. Set this to true if non-validated server certificates are to be accepted.
Type: bool.
Default: false.
certificateAuthorityFile
Used with TLS. By default, server certifications signed by all standard Certificate Authorities are validated. Optionally, you can set this option to provide a path to a CA certificate file in PEM format to authenticate the host with.
Type: string.
authentication/username
User name for authentication.
Type: string.
authentication/password
Password for authentication.
Type: string.
authentication/certificateFile
Used by TLS. Optionally, you can set this option to provide a path to a CA certificate file in PEM format to authenticate the client with.
Type: string.
authentication/certificatePassword
Used by TLS. Optional password used to decrypt the client private key file, if encrypted.
Type: string.
authentication/privateKeyFile
Used by TLS. Optional path to a PEM file containing the private key, if not already included in the certificate file.
Type: string.
Important:
If you provide a password for authentication via the configuration file, you must ensure to protect the configuration file against any unauthorized access, since the password will be readable in plain text.