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

Unacked messages when working with reply and more option #192

Open
ptusch opened this issue Apr 16, 2019 · 3 comments
Open

Unacked messages when working with reply and more option #192

ptusch opened this issue Apr 16, 2019 · 3 comments

Comments

@ptusch
Copy link

ptusch commented Apr 16, 2019

When you work with the rpc feature of rabbot, you may be tempted to use the intermediate callback and more option.
If you do that (or plan to do that) be prepared to have a bunch of unacked messages in your queue.
There seems to be some weirdness that invalidates previously performed acks. It's a bit hard to explain, please have a look at the attached examples.

A workaround would be to use the noAck: true option upon consuming things. Of course, this may break your workflow so be vary.

@ptusch
Copy link
Author

ptusch commented Apr 16, 2019

rabbot_sample.tar.gz

@ptusch
Copy link
Author

ptusch commented Apr 16, 2019

I've pinpointed the issue down to the ackBatch processing.
Since my usecase uses the batchAacking, I have an interval that fires each 500ms.

So imagine using msg.reply before and the next msg.reply after the batch processing, you end up in invalid states. The messages count is down to 0 and further acks will not be performed, resulting in unacked messages.

A better workaround (though, requires code change) is to remove the raw.ack() call and call msg.ack() in your business logic.

@ptusch
Copy link
Author

ptusch commented Apr 16, 2019

I wad able to fix the issue. It's a bit disgusting but what can I say. It's working.
Please have a look if you feel like it: https://github.com/hufsm/rabbot/pull/21/files#diff-25b7d53c91b664dd589db8a4e4e02119

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

1 participant