-
Notifications
You must be signed in to change notification settings - Fork 229
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
server is not making qos 1/2 assurance when subscribed client not response puback #439
Comments
Given MQTT is based on TCP, with well behaved (conforming to MQTT spec) client and server, only when there is a break in the TCP connection may result in server not receive PubAck. Hence, the un-acked messages are only resent when the client reconnects to the server. Lines 467 to 468 in 8f52b89
In addition, with MQTT, there is Publisher, Broker and Subscriber:
Each segment has its own respective QoS. For example, the publish QoS only dictates the delivery guarantee for Publisher to the Broker portion. Subscriber defines its QoS in the subscription message. Generally you can consider the end-to-end QoS is the min(Publisher QoS, Subscriber QoS), assuming the server allows up to QoS 2. Given the Publish API is to "simulate" a Publisher publishing to a topic, it returns when the Broker can accept the message. |
@cxshun, does the above resolve your concern? |
Thanks @thedevop for your reply, sorry to reply such late.
We know tcp disconnect only happen when keepalive timeout or active disconnect, so in my above situation, may be device is in its keepalive period, so it will not reconnect, so the message may not deliver again in its connection. So the code segment that you post: if sessionPresent {
err = cl.ResendInflightMessages(true) will not be able to trigger. We try to check EMQX, It seems to implement this assurance. Look forward to more dicussion! |
Background
We are testing qos assurance, but found that mochi-mqtt is not assure qos 1message's delivery.
But I walk through mochi-mqtt's readme. It says it implements Full qos 1/2.
Our testcase demonstrate like below:
So with this testcase, we want this message to resend interval.
Code walk through
I'm not sure if I was making the right conclusion.
Here I walk through the code, but not finding anything about qos =1/2's retrying.
Below is the code that I was walked through, Please feel free If I was missing something.
I found that after WritePacket, if it didn't encouter any error, It will treat the message as publish success.
Expect
When subscribed client didn't response puback, server must resend message to ensure qos =1 or 2.
Please feel free to tell me that if I was missing something.
The text was updated successfully, but these errors were encountered: