Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[paho-dev] MqttAsyncClient - inflight message limit

Hi,

I started implementing a solution based on the java MqttAsyncClient since I needed to obtain the IMqttToken for message bookkeeping due to some limitiations with the syncClient.

However I noticed the following :

When sending a substantial number of msgs in a short timestamp, the risk of running into the max inflight messages is very high (writing a loop that sends 20 msgs to a topic results in "Too many publishes in progress (32202)" about half of the time. 

This is not the case with the syncClient because you allow for some time for the message to get sent before moving on to the next one.

How should we handle this ? Our broker is perfectly capable of handling this type of load, but here it seems that the client is the bottleneck.

Should the asyncClient always be used by specifying a waitForCompletion on the mqttDeliveryToken to avoid having too much inflight messages in the client ?

mqttDeliveryToken.waitForCompletion(200);

Regards,
Davy


Back to the top