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

Overwrite Retryconditions #868

Open
wasserholz opened this issue Sep 23, 2024 · 2 comments
Open

Overwrite Retryconditions #868

wasserholz opened this issue Sep 23, 2024 · 2 comments

Comments

@wasserholz
Copy link

First of all, thanks for this great rest client.

Currently it is not possible to overwrite retry conditions on a request

Use case:
Most requests to a specific API should retry on any error except for one endpoint.
For that one endpoint I am creating an object and the endpoint returns 400 with an app error code specific to that endpoint. As the object exists, it is fine to not retry.

I have now a client wide retry on error, AddRetryAfterErrorCondition(), but for that one request I want it do use my customer retry function only. This would only work if I manually remove the client wide retry condition or use a new client for this specific request.

It would be great to be able to overwrite client wide configuration in each request, so it is possible to avoid work-arounds.

@wasserholz
Copy link
Author

For now I have encapsulated the rest client into a wrapper type with receiver functions, which then add the retry conditions on each request to avoid repetition and client wide config.

@jeevatkm
Copy link
Member

@wasserholz Thanks for reaching out. In the upcoming Resty v3, retry controls will be added to the Request level to prevent retrying on particular requests; refer to #752.
Can you elaborate on the overwrite condition? I do not understand. Typically, conditions will not occur when you turn off the retry on request.

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

No branches or pull requests

2 participants