-
Notifications
You must be signed in to change notification settings - Fork 727
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
application controlled acknowledgements to match Java behaviour #753
Conversation
@BBBSnowball @HaraldGustafsson Does this look like it solves the problem? Perhaps try out the branch and confirm if it works for you? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you also add a Signed-off to your commit ? This is a requirement from Eclipse to acknowledge you agree with the ECA.
Co-authored-by: Pierre Fersing <[email protected]>
Co-authored-by: Pierre Fersing <[email protected]>
Co-authored-by: Pierre Fersing <[email protected]>
Co-authored-by: Pierre Fersing <[email protected]>
all good improvments. Thanks @PierreF ! |
Thank for your contribution. |
Thanks! I think a lot of people are helped by this new function. |
The existing python library acknowledges all messages received after calling the on_message() callback configured by the application. This PR adds manual_acks=False as an argument to client.py/init() function. When manual_acks=True, the application must acknowledge receipt of every message using the newly created ack(mid,qos) entry point.
This PR addresses issue #348 to allow applications to delay acknowledgement until it has completely received it. There was a first PR (#554) submitted two years ago. and got some great feeback from it:
After much too and fro, it was fairly clear that the library cannot be responsible for ordering. Then it occurred to me, that the Java implementation exists, and the equivalent functionality has been present for a number of years, and so chances are that it is doing "the right thing" tm.
So this PR uses the java implementation as a model, and slavishly implements the same thing in Python.
To illustrate the relationship to Java implementation, we can compare some tidbits:
So in python we have:
vs. Java:
There is a need for an implementation of a call to be used by the library user to actually send the acknowledgements. we can compare code here also:
python:
versus Java:
In the java, there was an existing messageArrivedCompleted entry point to adjust. In python, nothing similar was obvious, so modified _handrel which would only apply in QoS==2... to suppress sending of pubcomp when manual_acks is active.