[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
Re: [mosquitto-dev] PUBACK sent after disconnect on publish
|
Benjamin Cabé <contact@xxxxxxxxxxxxxxxxx> writes:
> The MQTT specification says:
>
> The receiver is not required to complete delivery of the Application
> Message before sending the PUBACK. When its original sender receives the
> PUBACK packet, ownership of the Application Message is transferred to the
> receiver.
>
> So in your case since the receiver (Mosquitto) couldn't send the PUBACK, it
> is not violating the spec by not having processed the message, and the
> sender still has ownership of it. I guess it brings an interesting
> discussion on whether the message should at least be retained... is that to
> be considered part of the "delivery"?
I consider retained to be something that should happen if and only if
the messages is published.
The language about the sender receiving the PUBACK is odd. There is
basic problem in that it can't really work that way. Basically:
sender sends messaage
broker receives it
broker publishes it and/or writes it to stable
storage so that it would be published later
broker sends puback
sender gets puback
The broker basically has to treat the message as committed to it before
it sends puback. I suppose it can undo this if the puback fails.
The real questions are:
If a client doesn't actually want a puback, isn't it broken to ask for
one. I'd say yes.
If the broker receives a message, I don't think it should decline to
publish it becuase sending the puback fails. I am not saying it is
technically provably wrong if so, just that I cannot see how this is
at all helpful.