-
Notifications
You must be signed in to change notification settings - Fork 6
QoS2: No PUBCOMP packet is send from client #18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Thanks for your quick reply. In my case, the broker publishes to the client (LabVIEW) as this broker is the bridge. I extracted the relevant parts to make it clear: 1664285329: Sending PUBLISH to LabVIEW (d0, q2, r0, m1, 'ACC', ... (367 bytes)) |
I am seeing the same thing, there is a bug with subscribing with a QoS =2. To reproduce, set both publish and subscribe to Qos = 2 and publish data. After about 20 messages the user event from a publish does not happen anymore. the subscribe just stops for that topic, unsubscribe/subscribe does not fix or work after. |
@jaddik, thanks for making this clear. I actually did not solve the problem so far and hope that your comment will lead to a solution. |
@VVVVVane PUBREL can only be received by the broker, so the client would never have to handle this packet type as a valid incoming packet. |
|
In the MQTT protocol, if you are a subscribing client and receive a message with QoS 2, you indeed need to reply with PUBCOMP. This is because QoS 2 guarantees "exactly once" delivery of messages, which involves a four-step acknowledgment process. QoS 2 Message Acknowledgment Process
Key Points
Therefore, as a subscribing client, if you receive a message with QoS 2, you must reply with PUBCOMP to complete the acknowledgment process and ensure the accurate delivery of the message. |
@VVVVVane Worse case scenario, we need a specific override in the Client Handle Request to store/discard IDs (and prevent race conditions in reservation of IDs for reuse) |
As a subscribing client in MQTT, if you do not reply with PUBCOMP after receiving a message with QoS 2, the flight window will continue to increase while waiting for the acknowledgment. |
I am facing some problems using QoS 2. I adapted one of your templates for this purpose. The result looks not like it should look like. No PUBCOMP is send from the client to the broker. Attached is a detail of the command line of the broker (additional information: This broker is bridged with another broker from which data is received with QoS 2 as well).
After few to LabVIEW published packages (max_inflight_messages), no further packages are published. Connection remains stable.
1664285329: Received SUBSCRIBE from LabVIEW
1664285329: IMWind/ACC (QoS 2)
1664285329: LabVIEW 2 ACC
1664285329: Sending SUBACK to LabVIEW
1664285329: Received PUBLISH from WIND.bridge-01 (d0, q2, r0, m38661, 'ACC', ... (368 bytes))
1664285329: Sending PUBREC to WIND.bridge-01 (m38661, rc0)
1664285329: Received PUBREL from WIND.bridge-01 (Mid: 38660)
1664285329: Sending PUBLISH to LabVIEW (d0, q2, r0, m1, 'ACC', ... (367 bytes))
1664285329: Sending PUBCOMP to WIND.bridge-01 (m38660)
1664285329: Received PUBREC from LabVIEW (Mid: 1)
1664285329: Sending PUBREL to LabVIEW (m1)
1664285329: Received PUBREL from WIND.bridge-01 (Mid: 38661)
1664285329: Sending PUBLISH to LabVIEW (d0, q2, r0, m2, 'ACC', ... (368 bytes))
1664285329: Sending PUBCOMP to WIND.bridge-01 (m38661)
1664285329: Received PUBLISH from WIND.bridge-01 (d0, q2, r0, m38662, 'ACC', ... (365 bytes))
1664285329: Sending PUBREC to WIND.bridge-01 (m38662, rc0)
1664285329: Received PUBREC from LabVIEW (Mid: 2)
1664285329: Sending PUBREL to LabVIEW (m2)
1664285329: Received PUBLISH from WIND.bridge-01 (d0, q2, r0, m38663, 'ACC', ... (362 bytes))
1664285329: Sending PUBREC to WIND.bridge-01 (m38663, rc0)
1664285329: Received PUBREL from WIND.bridge-01 (Mid: 38662)
1664285329: Sending PUBLISH to LabVIEW (d0, q2, r0, m3, 'ACC', ... (365 bytes))
1664285329: Sending PUBCOMP to WIND.bridge-01 (m38662)
1664285329: Received PUBREC from LabVIEW (Mid: 3)
1664285329: Sending PUBREL to LabVIEW (m3)
1664285329: Received PUBREL from WIND.bridge-01 (Mid: 38663)
1664285329: Sending PUBLISH to LabVIEW (d0, q2, r0, m4, 'ACC', ... (362 bytes))
1664285329: Sending PUBCOMP to WIND.bridge-01 (m38663)
1664285329: Received PUBLISH from WIND.bridge-01 (d0, q2, r0, m38664, 'ACC', ... (364 bytes))
1664285329: Sending PUBREC to WIND.bridge-01 (m38664, rc0)
1664285329: Received PUBREC from LabVIEW (Mid: 4)
1664285329: Sending PUBREL to LabVIEW (m4)
Is there some mechanism I don't get right or is there any bug?
The text was updated successfully, but these errors were encountered: