Skip to content
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

Add a way to acknowledge a message only with Id #245

Open
zamazan4ik opened this issue Dec 9, 2022 · 3 comments
Open

Add a way to acknowledge a message only with Id #245

zamazan4ik opened this issue Dec 9, 2022 · 3 comments

Comments

@zamazan4ik
Copy link

Hi.

Right now library provides a way to acknowledge a message with the following function: https://docs.rs/pulsar/latest/pulsar/consumer/struct.Consumer.html#method.ack

As you see, it consumes the whole Message as a ref. However, internally it uses only an Id field. During the integration of acknowledgment mechanism into Vector I have found that would be much more convenient to have a way just to pass an id instead of the whole message (at least because Message does not support Clone).

Could you please change the corresponding method (would be a breaking change, I guess) or provide an additional method smth like ack_with_message_id to resolve the problem? Thanks!

P.S. Yeah, I know that I can grab acker and emulate the same behavior with it. I think having ack_with_message_id has better UX for the users.

@zamazan4ik
Copy link
Author

Oh, acker is not visible outside the crate :( Could you please make acker just pub please? :)

@zamazan4ik
Copy link
Author

And I have some more ideas for the API:

  • make Message cloneable, if it's possible
  • implement Debug for Message and Consumer

@fmassot
Copy link

fmassot commented Feb 1, 2023

@zamazan4ik It may be fixed by the merged PR #252 from @ChillFish8

Can you check and close if it satisfies your needs?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants