Send many publish message: Too many publishes in progress Error

后端 未结 1 1887
野趣味
野趣味 2021-01-14 19:33

Here is paho Async client:

    client = new MqttAsyncClient(appProps.getProperty(\"mqtt.broker\"),
            appProps.getProperty(\"mqtt.clientId\"), new M         


        
相关标签:
1条回答
  • 2021-01-14 20:02

    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.

    0 讨论(0)
提交回复
热议问题