Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [paho-dev] controing generated persistent messages

Hello Roger,

That's super helpful!  I was only thinking about retransmission in the broker... I guess what the python client does matters also, but the patch I put into the python client just makes automatic sending of ack's by the library optional, adding an ack() function to let the application send them on its own.

Because in the scheme described, A Standards compliant client will never resend a message unless there is a re-connect, that would be awful if using a lossy network... so I guess they are depending on TCP underneath to deal with lossy networks... yeah that sounds like a reasonable/smart choice, so the MQTTv5 retransmits are only for cases where the connection actually broke... OK that makes it efficient in high queue cases.

OK so with v5, doing the acknowledgements a little later is no problem at all? So then my patch should be harmless in v5, and only change things in v3.x for cases of slight queuing, where it will make things slightly worse.

If someone deals with the current pull request, I can work on fixing retransmission for v5 as Roger prescribes in a future patch.

On Sat, Mar 27, 2021 at 5:47 AM Roger Light <roger@xxxxxxxxxx> wrote:
Hi Peter,

I can't speak for other maintainers, but I don't have much time for
spare time projects at the moment and other things have higher
priority for me than the Python client.

> Yeah, I don't want to suffer the excess overhead of QoS==2, so I use QoS==1... the continuous
> retransmission thing I had heard that MQTT does... The thing is, for the protocol to work, it has to
> leave some time for the acks to happen at all, so it cannot be too frequent.  This guy did the homework:
> It shows retransmissions happening 9 seconds, 7 seconds, then 20 seconds later...

It's retransmitting at a 20 second interval. I was under the
impression that this had been removed from the Python client years
ago, it seems I am wrong!

> Does anyone know of a reference that describes how brokers are supposed
> to decide when to resend with QoS==1 ?  I looked through the OASIS standard,
> and did not see anything,

In v3.1.1 brokers/clients must resend any unacknowledged PUBLISH
messages when they reconnect - section 4.4. They *may* retry in other
In v5.0 brokers/clients must resend any unacknowledged PUBLISH
messages when they reconnect - section 4.4. They must not retry in any
other circumstances.

For a long time now the general view that I am aware of is that even
in v3 message retry should only happen on reconnect.

The automatic retry needs removing because it makes the client not
compliant with the v5 spec, and is a bad idea anyway.


paho-dev mailing list
To unsubscribe from this list, visit

Back to the top