配置
生成密码文件
mosquitto_passwd -c myPasswordFile username password
修改配置文件内容
listener 1883 allow_anonymous false password_file myPasswordFile
使用配置文件启动
mosquitto -c mosquitto.conf
订阅/发布
mosquitto_sub -h 192.168.64.208 -t topic -u activemq -P activemq mosquitto_pub -h 192.168.64.208 -t topic -u activemq -P activemq -m "How are you?"