环境信息
- EMQX 版本:4.4.4
- 操作系统及版本:windows10
- 其他
问题描述
问题:mqtt客户端(golang版本)在publish和subscribe操作时不会返回ACL鉴权失败信息
预期效果:如果是ACL鉴权失败,客户端应该能感知到,而不是误以为鉴权ok,但实际上报错了只是客户端感知不到
配置文件及日志
for i := 0; i < 5; i++ {
text := fmt.Sprintf("this is msg #%d!", i)
token := c.Publish("testtopic", 1, false, text)
fmt.Println(token.Wait(),token.Error()) // 返回true nil
}
2022-09-15T02:20:14.376889+00:00 [warning] demo1@172.17.0.1:49052 [Channel] Cannot publish message to testtopic due to Not authorized.
2022-09-15T02:20:14.378814+00:00 [warning] demo1@172.17.0.1:49052 [Channel] Cannot publish message to testtopic due to Not authorized.
2022-09-15T02:20:14.380407+00:00 [warning] demo1@172.17.0.1:49052 [Channel] Cannot publish message to testtopic due to Not authorized.
2022-09-15T02:20:14.382309+00:00 [warning] demo1@172.17.0.1:49052 [Channel] Cannot publish message to testtopic due to Not authorized.
2022-09-15T02:20:14.384890+00:00 [warning] demo1@172.17.0.1:49052 [Channel] Cannot publish message to testtopic due to Not authorized.