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