Why listeners are global listeners? #484
Closed
yura-arab4uk
started this conversation in
General
Replies: 1 comment 5 replies
-
See if this attribute on the
|
Beta Was this translation helpful? Give feedback.
5 replies
# for free
to join this conversation on GitHub.
Already have an account?
# to comment
-
In my project I wanted to add a listener and use along with @retryable annotation.
But when I add a listener it's automatically considered by Spring Retry as global one, meaning it will be applied at least to every method marked with @retryable annotation, which prevents me from creating listener, because I don't want to impact existing code.
I prefer having explicit and clean way with @retryable annotation and its attributes, but because of global listener I'm forced to use interceptor attribute only and move all retry logic behide the scenes, which is not convenient.
Is that done for a reason? Can we provide some local listener or just onError attribute or any other alternative attribute which will only apply to a specific @retryable method and will allow us to perform some side effects in case exception is thrown?
Beta Was this translation helpful? Give feedback.
All reactions