spring-integration-mqtt
-> https://github.com/eclipse/paho.mqtt.java- paho-mqtt https://github.com/eclipse/paho.mqtt.rust
- go-mqtt https://github.com/eclipse/paho.mqtt.golang
brew install mosquitto
sh start_mosquito.sh
brew install emqx
emqx start
$ emqx ctl status
Node 'emqx@127.0.0.1' 5.3.2 is started
emqx stop
http://localhost:18083/ The default user name and password are admin
& public
API 密钥 设置API Key
和Secret Key
ak:9b71d224bd62f378 sk:mz0kFjgqbHPTUTAiBFcoY4rbmIsD3QXwJbaKQcNErlI
curl -i \
-u 9b71d224bd62f378:mz0kFjgqbHPTUTAiBFcoY4rbmIsD3QXwJbaKQcNErlI \
"http://localhost:18083/api/v5/nodes"
curl -i \
-u 9b71d224bd62f378:mz0kFjgqbHPTUTAiBFcoY4rbmIsD3QXwJbaKQcNErlI \
"http://localhost:18083/api/v5/topics"
curl -i \
-u 9b71d224bd62f378:mz0kFjgqbHPTUTAiBFcoY4rbmIsD3QXwJbaKQcNErlI \
"http://localhost:18083/api/v5/trace"
http://localhost:18083/api-docs/index.html#/Publish/post_publish
curl -i \
-u 9b71d224bd62f378:mz0kFjgqbHPTUTAiBFcoY4rbmIsD3QXwJbaKQcNErlI \
-X 'POST' \
'http://localhost:18083/api/v5/publish' \
-H 'accept: application/json' \
-H 'Content-Type: application/json' \
-d '{
"topic": "mqtt/test",
"payload": "hello emqx api"
}'
http://localhost:18083/api-docs/index.html#/Clients/post_clients__clientid__subscribe
curl -i \
-u 9b71d224bd62f378:mz0kFjgqbHPTUTAiBFcoY4rbmIsD3QXwJbaKQcNErlI \
-X 'POST' \
"http://localhost:18083/api/v5/clients/java_publish_client/subscribe" \
-H 'accept: application/json' \
-H 'Content-Type: application/json' \
-d '{
"topic": "mqtt/test"
}'
https://www.emqx.io/docs/zh/latest/deploy/upgrade-from-v4.html#http-api
使用emqx实验时,确保http://localhost:18083/#/authentication页面中没有配置
build.sh
mvn clean install -DskipTests
cargo build
go env -w GOPROXY=https://goproxy.cn,direct
go get github.com/eclipse/paho.mqtt.golang
go build
start_service.sh
cd mqtt-service
mvn spring-boot:run
look_up.sh
curl http://localhost:8080/temps/stats
start_sensor.sh
cd mqtt-sensor
mvn spring-boot:run
cargo run --bin sub
cargo run --bin pub
go run main.go