hivemq / hivemq-mqtt-client

HiveMQ MQTT Client is an MQTT 5.0 and MQTT 3.1.1 compatible and feature-rich high-performance Java client library with different API flavours and backpressure support
https://hivemq.github.io/hivemq-mqtt-client/
Apache License 2.0
832 stars 153 forks source link

QoS1 message with PUBACK with next message #579

Closed KeithLaiKB closed 4 months ago

KeithLaiKB commented 1 year ago

In QoS1 in MQTT: there are 2 process in MQTT communication, 1.Publisher to Broker 2.Broker to Subscriber In each process, when the server(publisher/broker) does not receive the PUBACK from the client(broker/subscriber) about messageA, will the server keep sending the second message messageB to the client? It seems like there is no reference mentioned that clearly.

pglombardo commented 4 months ago

Hi @KeithLaiKB,

If I understand your question correctly, this section in the MQTT 5 specification should answer your question:

When a Client reconnects with Clean Start set to 0 and a session is present, both the Client and Server MUST resend any unacknowledged PUBLISH packets (where QoS > 0) and PUBREL packets using their original Packet Identifiers. This is the only circumstance where a Client or Server is REQUIRED to resend messages. Clients and Servers MUST NOT resend messages at any other time

The key point being: Clients and Servers MUST NOT resend messages at any other time

Since it's been quite some time since this issue was filed, I'll close this issue out. But if this doesn't answer your question or if you have any other issues, let us know. We'd be happy to help out!