4

I am using Spring Integration MQTT which is using Eclipse Paho client to send MQTT messages to an Artemis server. When running a performance test on my application I receive an 'Too many publishes in progress' error. I know that I can fix this by setting the maxInflight property on the connection options to an higher number (max. 65535).

Does anyone know why the default maxInflight is only 10 and if there is any downside to increasing the maxInflight?

Wim
  • 1,967
  • 11
  • 19

1 Answers1

6

I found this article with some recommendations like:

setting max in-flight to 65535 is not recommended – some space for IDs should be left for those service packets to avoid same “Internal error, caused by no new message IDs being available” exception.

But then above the author says:

Still, setting max in-flight to 65000 or so (or even 32768, half of possible IDs space) will give one much more space for queued to be published QoS 1/2 messages than default limit of 10

The "fallback to QoS 0" is a good choice as well.

We can expose maxInflight option on the DefaultMqttPahoClientFactory though for convenience. Fell free to raise a JIRA on the matter.

Artem Bilan
  • 113,505
  • 11
  • 91
  • 118