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

Delay a retry by X seconds #166

Closed
hannesvdvreken opened this issue Nov 18, 2021 · 1 comment · Fixed by #167
Closed

Delay a retry by X seconds #166

hannesvdvreken opened this issue Nov 18, 2021 · 1 comment · Fixed by #167
Labels
enhancement New feature or request

Comments

@hannesvdvreken
Copy link

Is there a feature to handle errors from a handler, so that the Bus sends the message back to the queue, but with a specific delay (cfr the SQS visibility timeout).

The use case:

a Rate Limit is hit while getting a single item from an API. Based on the rate limit response headers you can calculate exactly how long you need to back off.

Is there a specific feature one can use to do this? Right now the error happens in the handler and the message gets sent back to the queue. The workers retry X times and then the message gets discarded.

I'm looking at the docs but haven't seen anything interesting to solve it.

The only thing I can think of is the onError lifecycle hook, but I'm not sure if you can modify the RawMessage to add a delay.

Any advice is greatly appreciated!

@adenhertog
Copy link
Contributor

This feature doesn't exist yet but is definitely on the table. The idea is to allow consumers to provide a RetryStrategy where you can write your own rules on how long to retry, and maybe provide some prebuilt ones like ExponentialBackoff or JitterLinearBackoff etc.

I'll use this issue to track it, thanks for raising it.

@adenhertog adenhertog added the enhancement New feature or request label Nov 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants