What happens if the MQTT QoS 2 PUBCOMP packet is lost?
According to the MQTT specification, QoS 2 guarantees exactly-once delivery. It provides the highest level of reliability, but requires a four-step handshake between the publisher and the broker:
PUBLISH – The publisher sends the message to the broker.
PUBREC – The broker acknowledges receipt of the message. If the publisher does not receive PUBREC, it resends the PUBLISH.
PUBREL – After receiving PUBREC, the publisher sends PUBREL.
PUBCOMP – The broker sends PUBCOMP to indicate that it has completed processing the message.
My Question
What happens if the PUBCOMP packet is lost?
The broker has already deleted the message and its packet ID after sending PUBCOMP.
But the publisher never received the PUBCOMP.
How does the broker know that the publisher did not receive the PUBCOMP?
And how does the publisher eventually complete the QoS 2 flow if the broker has already removed the packet ID and message?
Read more here: Source link
