Send many publish message: Too many publishes in progress Error

烂漫一生 提交于 2019-12-01 11:00:27

Looking at the source for the Paho client it looks like the default maximum number of inflight messages at any given time is 10.

So given how tight your publish loop is it will only take a small slow down in the network layer and your going to end up with more than 10 messages in the process of being sent at any given time. This will only get worse if you try to send at a QOS greater than 0.

You can change the default with the setMaxInflight(int n) method on the MQTTConnectionsOptions object that is passed to the client.connect() method.

I suggest you experiment to find a suitable value.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!