I currently have a variable coming from a property file, declared as:
@Value("${retryLimit}")
private int retryLimit;
That I would like to use in an annotation instead of the hard-coded constant "3" in this case:
@Retryable(maxAttempts = 3, backoff = @Backoff(delay = 2000))
Is this possible?
I've tried:
@Retryable(maxAttempts = @Value("${retryLimit}"), backoff = @Backoff(delay = 2000))
However I get the following compile error:
"Incompatible types. Found: 'org.springframework.beans.factory.annotation.Value', required: 'int'"