Salesforce

Installing Eclipse Mosquitto (Magic xpi 4.14)

« Go Back

Information

 
Created BySalesforce Service User
Approval Process StatusPublished
Objective
Description

Installing Eclipse Mosquitto (Magic xpi 4.14)

This section describes how to install Eclipse Mosquitto. The Magic xpi Local Agent uses Mosquitto as the MQTT Broker for Communication Service.

It is recommended to use Eclipse Mosquitto on the Windows. If you are using any other MQTT Broker refer to its documentation for installation.

Download and Installation

Eclipse Mosquitto can be downloaded from:

https://mosquitto.org/download/

Mosquitto version 1.5.x is tested and certified for Magic xpi.

After downloading, install Eclipse Mosquitto.

Once the installation is done, navigate to <Magic xpi Installer>\LocalAgent\Prerequisites\Mosquitto and copy the files listed below to the Mosquitto installation folder:

· broker.cmd

· mosquitto.pass.txt

· mosquitto_localagent.conf

Configuration

Eclipse Mosquitto provides two modes for running the application.

· Anonymous Mode

· Broker Authentication Mode

Local Agent supports both the modes. If the Mosquitto broker is installed behind an API gateway which has its own authentication, the anonymous mode is recommended, as it requires less configuration.

Anonymous Mode

The Anonymous mode is the default mode and requires two files:

· Configuration file (e.g. mosquito_localagent.conf)

· Command file (e.g. broker.cmd)

The user can change the ports and log file names in the configuration file as per requirement.

Broker Authentication Mode

Before switching to the Broker Authentication Mode, Local Agent should be installed on the system.

When using the Broker Authentication Mode, add a password file to the Mosquitto folder and give a proper reference in the configuration file.

Enter the required User Name and Password in the following files:

· application.properties files for Agent Service and Agent Connector

· mgmt-console-api.properties for Management Console

· magic.ini for Magic xpi server

For example, with username as localagent, the following call should be performed in the Mosquitto folder to create the password file:

mosquitto_passwd -c mosquitto.pass.txt localagent

After running this command the user will be asked to enter the password. On entering the password, the utility will create mosquitto.pass.txt file that contains the encrypted password.

The following changes should then be made to the configuration file:

· Change the allow_anonymous parameter as given:

allow_anonymous false

· Add two more lines that define username and password file:

user localagent

password_file .\msp.txt

In the application.properties files, corresponding entries should match the broker username and password, for example:

mqtt.broker.username=localagent

mqtt.broker.password=12345qwerty

These values are default and are written by the installer of the Local Agent. Any other values require manual adjustment.

Starting the Eclipse Mosquitto MQTT Broker

Go to the Mosquitto installation folder and run broker.cmd.

Reference
Attachment 
Attachment