简体   繁体   中英

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

I just noticed from the change in mosquitto 1.4.5 to 1.5 that the retry_interval variable was removed given with the justification written below. Written in the change_log.txt. see 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.

The rational of the removal is if the client is overloaded and cannot respond anyway so there is no need to resend. But according the the QoS 1 and 2 definition of the protocol in Oasis. 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.

I tried reading the source code change and it does remove the retry. I get the rational of the change but does it not broke the protocol compliance of the software? If the network is down for a long time, retrying to send would be useless but if the network failure is intermittent, removing the retry would make the QoS > 0 to be unreliable for this broker?

The retry_interval option controlled the case where a message was not acknowledged during normal operation, ie the client didn't appear to have disconnected but wasn't sending acknowledgements.

The message delivery retry discussed in the spec covers the case where the client reconnects. This behaviour is present in Mosquitto, so there is no violation of the spec, and the messages will be retried.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM