[3] mqtt,mosquitto,eclipse Paho---How do I use the Eclipse Paho MQTT tool to send a subscription to an MQTT message?

Source: Internet
Author: User

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?

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.