1、本地电脑安装如下的mqtt windows安装包,
配置教程
https://blog.csdn.net/phmatthaus/article/details/138287697
按照如上链接进行配置,增加用户
注意事项:
① 配置不允许匿名登录
listener 1883 127.0.0.1
allow_anonymous false
② 增加用户(密码设置为123456)
.\mosquitto_passwd.exe -c .\pwfile.example dx01
③ 重启mosquitto.exe服务后(详细步骤见https://blog.csdn.net/phmatthaus/article/details/138287697),执行配置生效命令
.\mosquitto.exe -c mosquitto.conf
2、解压fly_control.rar,运行项目(此项目无任何依赖,非常方便启动, 使用8201端口)
3、调用生产5G-A通感数据接口
方式:
GET
url:
http://localhost:8201/mqtt/pubMsg
请写消费端对消息进行接收,并将接收到的消息转化为消息对象