我正在使用 Spring Integration MQTT,它使用 Eclipse Paho 客户端将 MQTT 消息发送到 Artemis 服务器。在我的应用程序上运行性能测试时,我收到“正在进行的发布过多”错误。我知道我可以通过将连接选项上的 maxInflight 属性设置为更高的数字(最大 65535)来解决此问题。
有谁知道为什么默认的 maxInflight 仅为 10 以及增加 maxInflight 是否有任何缺点?
最佳答案
我找到了这个 article有一些建议,例如:
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.
但是上面作者说:
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
“回退到 QoS 0”也是一个不错的选择。
为了方便起见,我们可以在 DefaultMqttPahoClientFactory
上公开 maxInflight
选项。随意提出一个JIRA关于这件事。
关于java - 在 Paho MQTT Java 客户端上增加最大飞行时间有什么缺点吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48581710/