Mosquitto_pub and mosquitto_sub Command parameter description

Source: Internet
Author: User

Mosquitto_pub Command parameter description


1.-D Print Debug information


2.-F to send the contents of the specified file as the content of the message


3.-h Specifies that the domain name to be connected defaults to localhost


4.-i specifies which ClientID users to send messages to


5.-i specifies which ClientID prefix the user sends a message to


6.-M message content


7.-N sends an empty (NULL) message


8.-P Connection Port number


9.-Q Specifies the value of QoS (0,1,2)


Ten.-T Specify topic


-u Specifies broker Access user


-p Specifies broker access password


-v Specifies the MQTT protocol version


--WILL-PAYLOAD specifies a message that is emitted when the client disconnects unexpectedly from the broker. This parameter needs to be used with--will-topic


The QoS value of--will-qos. This parameter needs to be used with--will-topic


--will-retain specifies that the will message is treated as a retain message (that is, after the message is broadcast, the message is retained). This parameter needs to be used with--will-topic


--will-topic user sends the topic of the would message




Mosquitto_sub Command parameter description


1.-C Set the ' Clean Session ' to an invalid state, so that the subscription status is maintained, even if the connection has been lost, if the connection is still able to receive the message sent during the disconnection.


2.-D Print Debug information


3.-h Specifies that the domain name to be connected defaults to localhost


4.-I specify ClientID


5.-I specify ClientID prefix


6.-K keepalive every once in a while, the ping message notifies the broker that it is still in a connected state. The default is 60 seconds.


7.-Q Specifies the message that you want to receive QoS for why the default QoS is 0


8.-R does not display stale messages


9.-T Subscription topic


Ten.-V Print messages


One.--WILL-PAYLOAD specifies a message that is emitted when the client disconnects unexpectedly from the broker. This parameter needs to be used with--will-topic


The QoS value of--will-qos. This parameter needs to be used with--will-topic


--will-retain specifies that the will message is treated as a retain message (that is, after the message is broadcast, the message is retained). This parameter needs to be used with--will-topic


--will-topic user sends the topic of the would message

Transfer from http://blog.itpub.net/28624388/viewspace-1440102/

Mosquitto_pub and mosquitto_sub Command parameter description

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.