-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
mqtt client receives msg with null topic in some cases #1503
Comments
You will need to first figure out whether the |
This is not caused by the broker, because when receive null topic, other clients can receive it normally. But when I restart nodejs, this mqtt client can receive correct topic value |
你用的什么broker,怎么能跑出来null topic |
和broker无关,用的是emqx的。我找到规律了,当mqtt连接成功后,如果后续的代码有一个长时间的cpu密集运算,比如一个耗时很长的for循环,那么在循环中,实际上mqtt客户端没有和broke连接了(因为cpu被分配给循环)。等循环结束后,mqtt会自动重连成功,但是这个时候虽然可以接收信息,但是topic居然是null。 既然能收到消息,说明topic寻址是正常,而回调中topic为空,应该是这个mqtt的bug导致。 这个问题在部分场景下可以利用 v5版本的 properties特性来携带topic,但是这个场景不能解决所有的问题, 希望有大侠能解决这个bug,谢谢 |
This is an automated message to let you know that this issue has If this issue is still important, you can simply comment with a Thank you for your contribution. |
MQTT 5.0.0 BETA is now available! Try it out and give us feedback: |
This is an automated message to let you know that this issue has If this issue is still important, you can simply comment with a Thank you for your contribution. |
This issue was automatically closed due to inactivity. |
In most cases, mqtt client can receive the subscribed topic, but in some cases, mqtt client receives messages with null topic. I can reproduce this situation by trying to hibernate the server and then resume it.
But I don't know how to solve this problem when the received topic is null
The text was updated successfully, but these errors were encountered: