For this example we are using a CentOS 7 with a Mosquitto installation. For more information about Windows related installations refer to the internet. For more information about Mosquito refer to the Mosquitto Website.
To test your Mosquitto installation we are going to setup a subscription on a specific topic and send something to this topic. This is a Publish-Subscribe mechamism or PUBSUB as we say it.
Topics are descriptions that you announce communications to and subscribe to.
Now that we have subscribed to the topic test, lets send a text to this topic, in our second terminal, to see if we get any result.
mosquitto_pub -h localhost -t test -m "ConnectPlaza Mosquitto test"
Your server is up and running. You can disconnect from the subscriber using <CTRL-C>.
Import this file in your test environment, bundle it and deploy this to your test environment.
The MQTT Listener subscribes as in the previous example to the topic 'test'. The message will be send to Analyze and a file will be produced with the content of the messages send to the topic via the mosquitto_pub command.
Nothing special here. We connected to the URL on the localhost with the standard Mosquitto port number 1883. The Client URL can be anything. As you can see we subscribed to one topic, 'test', the rest is default.
De File Drop is simple, we save the file in the ConnectPlaza installation directory ./temp/output. This directory will be automatically created if it does not exist.
Open the file and you can read the message set in the publisher.
Lets send the message via an MQTT Producer. We create a message file test.txt with the following text: ConnectPlaza Send Test. This file will be picked up by ConnectPlaza and a MQTT-Producer will publish the message to the topic 'test'. The MQTT Listener from the previous example will pick up the message and drop the file to the same ./temp/output directory.
Send the test.txt file to the input directory and check if you have a result in your output directory. If all went well, you have a file. Open this file and check if the message is the same as in the text file.