Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [mosquitto-dev] PUBACK sent after disconnect on publish

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"?

Le sam. 22 févr. 2020 à 01:43, Greg Troxel <gdt@xxxxxxxxxx> a écrit :
Benjamin Cabé <contact@xxxxxxxxxxxxxxxxx> writes:

> mosquitto_publish() is asynchronous: having it return MOSQ_ERR_SUCCESS simply
> means that the publication of the message has properly been passed to the
> Mosquitto thread.
> You should use the publish callback to check/wait for message delivery.
>
> See similar question here: https://stackoverflow.com/q/60050736/1051634

Perfectly fair, but it seems to me that the broker not publishing
something because of a write error on puback is not right.  Maybe I am
off base w.r.t. to the spec and that is intended, though.


Back to the top