Mosquitto 从 1.4.15 更改为 1.5 是否抵消了 QoS 1 和 2 的优势?

Does the Mosquitto change from 1.4.15 to 1.5 cancelled out the benefit of QoS 1 and 2?

我刚刚从 mosquitto 1.4.5 到 1.5 的变化中注意到,retry_interval 变量已被删除,理由如下。写在change_log.txt。见 github link.

This change in behaviour can be justified by considering when the timeout may have occurred.

  • If a connection is unreliable and has dropped, but without one end noticing, the messages will be retried on reconnection. Sending additional PUBLISH or PUBREL would not have changed anything.

  • If a client is overloaded/unable to respond/has a slow connection then sending additional PUBLISH or PUBREL would not help the client catch up. Once the backlog has cleared the client will respond. If it is not able to catch up, sending additional duplicates would not help either.

删除的理由是如果客户端过载并且无论如何都无法响应,因此无需重新发送。但是根据Oasis中协议的QoS 1和2定义。 mqtt-v3.1.1-os

4.4 Message delivery retry

When a Client reconnects with CleanSession set to 0, both the Client and Server MUST re-send any unacknowledged PUBLISH Packets (where QoS > 0) and PUBREL Packets using their original Packet Identifiers.

我尝试阅读源代码更改,它确实删除了重试。我了解更改的合理性,但它不会破坏软件的协议合规性吗?如果网络长时间中断,重试发送将毫无用处,但如果网络故障是间歇性的,取消重试会使 QoS > 0 对该代理不可靠?

retry_interval 选项控制在正常操作期间未确认消息的情况,即客户端似乎没有断开连接但未发送确认。

规范中讨论的消息传递重试涵盖了客户端重新连接的情况。此行为存在于 Mosquitto 中,因此没有违反规范,消息将被重试。