In the last two sections, the author mainly introduces the basic concept of mqtt,mosquitto,eclipse PAHO how to install Mosquitto. In this section we will look at how to use the Eclipse Paho MQTT tool to send a receive MQTT message. The Eclipse Paho Mqtt tool is a Java-based Eclipse desktop client program whose underlying Java class library for interacting with MQTT servers is the Eclipse Paho Java library. Suppose we have started a Mosquitto MQTT server on this machine (127.0.0.1) with a port of 1883. How do I use the Eclipse Paho mqtt tool?
(1) Download Eclipse Paho MQTT
Https://repo.eclipse.org/content/repositories/paho-releases/org/eclipse/paho/org.eclipse.paho.ui.app/1.0.2/
(2) After decompression, double-click on the Paho.exe, open the interface as follows
(3) Click on the cross icon, you can create a new MQTT client connection, enter the correct MQTT server connection address,
For example, in this case the connection address is tcp://localhost:1883, and then click the "Connect" button, this time, if the MQTT server does not set the password (the default is no password), this time, we can see the connection to get the status (status) is "Connected".
(4) We will be able to subscribe to the news at this time. Select the Green Cross icon under "Subscription" to enter the name of the subscribed theme (topic), such as we set the theme name to "Test" and click the "Subscribe" button
(5) Send a message to the MQTT service subject to "test", the content is "Hello everyone, this is my message." "Mqtt message. Then click on "Publish" button, this time, we can see the message has been sent successfully, and in step (4) subscribed to the same topic also received the message.
Fantastic, congratulations, you've basically learned how to use the Eclipse Paho Mqtt tool as a client to send and receive messages.
[3] mqtt,mosquitto,eclipse Paho---How do I use the Eclipse Paho MQTT tool to send a subscription to an MQTT message?