-
Notifications
You must be signed in to change notification settings - Fork 95
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
Receive notification of acknowledgments when using async publish #216
Comments
Carrying on discussion from #207 comment by @vishnureddy17
Just to clarify; by "client instance" I meant the users program (rather than an instance of
This raises a few questions:
My thought was always that if autopaho is in use then whatever notification method is selected should survive reconnections (these should be mostly hidden from the end user). We do also need to handle the situation where the session is lost (either due to |
This is an interesting issue. Currently, the Another issue is that even if the library provided a way to re-register callbacks, the user would have to know to register it before a connection is established since messages get resent in One possible solution is to have a callback for "orphaned" messages. However, this callback may be of little use since the callback is for publishes that the application has lost track of. This could perhaps be mitigated by including the re-sent packets as part of arguments supplied to the callback. I think the problem of application restarts does not need to be solved immedidately. The solution for non-restarting applications is clearer, so it may be a better idea to solve that problem first.
Agree with this. |
Have been thinking about this following PR #264 (not yet accepted). The issue here is that packets are stored (to memory/disk) in two places (queue and session store), so in order to notify the client that a message has been sent we need to store some kind of ID so that the specific message can be identified and tracked through the queue/store. @shaileshahuja has had a go at this for the queue by adding a UUID that's maintained in a seperate map (or part of the filename fot the filestore). This would work but requires a range of changes and I had some concerns about requiring a UUID. I wonder if an alternative option is to make it the users responsibility to provide the ID and:
This would simplify the changes required (would be minimal) whilst providing the notification required. It would also enable the authors of stores (e.g. a databased queue) to extract the ID into a different database field if they want (parse the packet). It's definitly not perfect but I think it's a workable solution so thought I'd put it out there to see what others think. |
Is your feature request related to a problem? Please describe.
When using async PUBLISH (i.e.
PublishWithOptions
withPublishMethod_AsyncSend
) it's not currently possible to determine when the message has been acknowledged (with QOS 2 messages it would be useful to know when both steps are complete).Describe the solution you'd like
This was discussed a bit in issue #207 options include:
The text was updated successfully, but these errors were encountered: