MQTTX CLI 是 EMQ 开源的一款 MQTT 5.0 命令行客户端工具,也是命令行上的 MQTTX,旨在帮助模拟mqtt客户端。 https://mqttx.app/zh
brew install emqx/mqttx/mqttx-cli
curl -LO https://www.emqx.com/zh/downloads/MQTTX/${version}/mqttx-cli-linux-x64 sudo install ./mqttx-cli-linux-x64 /usr/local/bin/mqttx
mqttx bench pub \ -h '${mqtt-broker-endpoint}' \ -p 1883 \ -c 1000 \ -u '${username}' \ -P '${password}' \ -t 'devices/data' \ -m '{"temperature": 25, "humidity": 65}' \ --count ${client_number} \ --interval 100
mqttx bench pub \ -h '${mqtt-broker-endpoint}' \ -p 8883 \ -c 1000 \ -u '${username}' \ -P '${password}' \ -t 'devices/data' \ -m '{"temperature": 25, "humidity": 65}' \ --count ${client_number} \ --interval 100 --protocol mqtts