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

Retries handling - how to stop retrying a message after a number of failures #248

Closed
kartius opened this issue Mar 29, 2022 · 1 comment
Closed

Comments

@kartius
Copy link

kartius commented Mar 29, 2022

If parallel consumer got exception during the consuming event it try to process it again infinity amount. Could you suggest please, how can I handle retries and set a max limit?

@astubbs
Copy link
Contributor

astubbs commented Apr 19, 2022

Sorry, I didn't see your report sooner. Thanks for contributing!

Ah - yes, simply catch exceptions from your function, and do not throw any exception back up. I.e. "swallow" the exception. This will make PC think the processing has succeeded, and will continue. You can record the number of failed attempts somewhere in your code, or you can use the new PollContext object in the master branch which provides you with the failure count.

Also keep an eye on:

See:

@astubbs astubbs closed this as completed Apr 19, 2022
@astubbs astubbs changed the title Retries handling Retries handling - how to stop retrying a message after a number of failures Apr 19, 2022
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