You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I want, that each time the method getMyModel is called, the bean instanceCounter also should be called.
But there was different behavior than I expected. The bean instanceCounter was called just one time, when the getMyModel method was called first time. Other time when I call the method, the bean instanceCounter is not called.
Seems like the maxAttemptsExpression property was cached after first call. And after that, value of this property is always used from cache.
It's right? There is a way to set dynamic value to this property?
The text was updated successfully, but these errors were encountered:
BEdvin
changed the title
Is @Retryable annotation properties chached?
Are the @Retryable annotation properties chached?
Dec 13, 2016
dsyer
changed the title
Are the @Retryable annotation properties chached?
Are the @Retryable annotation properties cached?
Jan 12, 2017
You would need to re-instantiate the bean when the configuration changed. You can do that (for instance) with @RefreshScope from Spring Cloud. Or you could create a custom RetryPolicy and inject that into an interceptor that you create yourself (and reference via the "interceptor" attribute in @Retryable).
I'm using expression by declaring properties of the annotation. My example is given below:
I want, that each time the method getMyModel is called, the bean instanceCounter also should be called.
But there was different behavior than I expected. The bean instanceCounter was called just one time, when the getMyModel method was called first time. Other time when I call the method, the bean instanceCounter is not called.
Seems like the
maxAttemptsExpression
property was cached after first call. And after that, value of this property is always used from cache.It's right? There is a way to set dynamic value to this property?
The text was updated successfully, but these errors were encountered: