Here is paho Async client:
client = new MqttAsyncClient(appProps.getProperty(\"mqtt.broker\"),
appProps.getProperty(\"mqtt.clientId\"), new M
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.