-
Notifications
You must be signed in to change notification settings - Fork 510
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 functionality to annotation to allow a spel expressions #34
Comments
You could do that relatively easily today with
Where |
thanks Gary. I know the interceptor is available but in the spirit of conciseness it would be nice to have a spel expression |
It's probably not too hard for a single exception, but the
I am happy to discuss further, though. |
Understood. I would think that for more complex situations a developer would create an interceptor and for simple situations like mine it would be nice not to have to add all the extra boiler plate. I see a lot of annotations using spel like this and situations can occur like you suggested, but for ~ 80% of the scenarios it is very clean. I have need for the interceptor right now so that's what I am going to use. If you strongly feel that the expression is the wrong thing to do then that's fine. As a consumer of the api, who uses it a lot, it would be a nice feature to add. |
I just hacked together a quick PoC garyrussell@f2c98b7 Let's see what @dsyer thinks about whether it's worth pursuing. |
Hi, What I am really looking for is a way to configure the |
I didn't see this until now. Maybe a PR would help? |
I am very interested in this feature as well. I have considered writing my own due to this limitation. Otherwise, spring-retry appears very useful. |
The PoC just evaluates an expression against the exception to decide whether it was retryable or not (which is the original request in this issue). It does not address evaluating the I am offsite all next week so I don't think I could look at this before Dec 12 which might be too late for spring-retry 1.2. I'll see if I can spring free some time tomorrow, but no promises. |
I went ahead and issued a PR; not sure if we feel it's too big to add to 1.2 after the RC. I went with discrete attributes to avoid breaking changes. |
Further enhancement to spring-projects#34
Thanks for the quick action on this. I tried out the snapshot build and it works perfectly - just what we needed! |
@dsyer Please note I submitted another PR. |
It would be very useful if the @retryable annotation allowed an expression using spel to have an easy way to further inspect an exception in order to determine if a retry should occur.
For example:
The text was updated successfully, but these errors were encountered: