title: javanica @HystrixCommand and spring @Cacheable execution order
body: <p>In a Spring Application (not spring-boot), I'm using javanica @HystrixCommand annotation and spring cache @Cacheable annotation on the same bean method, Spring execute the cache advice before the Hystrix advice.
  It's what I'm waiting, but for me the cache advice and hystrix advice without any configuration have the same order in spring : LOWEST_PRECEDENCE.</p>
  
  <p>I wan't to know what make this order : is it defined somewhere or this an undefined order and I'm lucky to have the good order ?
  What must be done to ensure that cache advice will be executed before Hystrix advice (set order on cache:annotation-driven before LOWEST_PRECEDENCE ?)</p>
  
  <p>This is an example of my code :</p>
  
  <pre><code>...
  import org.springframework.cache.annotation.CacheConfig;
  
  import org.springframework.cache.annotation.Cacheable;
  import com.netflix.hystrix.contrib.javanica.annotation.HystrixCommand;
  import com.netflix.hystrix.contrib.javanica.annotation.HystrixProperty;
  ...
  
  
  @Service
  @Slf4j
  @CacheConfig(cacheManager="myCacheManager")
  public class MyRessourcesImpl implements MyRessources {
  ...
      @Override
      @HystrixCommand(commandProperties = {
              @HystrixProperty(name = "execution.isolation.strategy", value = "SEMAPHORE"),
              @HystrixProperty(name = "execution.isolation.thread.timeoutInMilliseconds", value = "10000") })
      @Cacheable("cacheName")  //from spring cache
      public Map&lt;String, String&gt; getTheMap() {
          ...
      }
  ...    
  }
  </code></pre>
  
  <p>With this spring config :</p>
  
  <pre><code>&lt;bean id="myCache" class="org.springframework.cache.ehcache.EhCacheManagerFactoryBean" &gt;
      &lt;property name="configLocation" value="classpath:/META-INF/...."  /&gt;
  &lt;/bean&gt;
  
  &lt;bean id="myCacheManager" class="org.springframework.cache.ehcache.EhCacheCacheManager"&gt;
      &lt;property name="cacheManager" ref="myCache" /&gt;
  &lt;/bean&gt;
  
  &lt;cache:annotation-driven cache-manager="myCacheManager" /&gt;
  
  &lt;aop:aspectj-autoproxy/&gt;
  
  &lt;bean id="hystrixAspect" class="com.netflix.hystrix.contrib.javanica.aop.aspectj.HystrixCommandAspect" /&gt;
  </code></pre>
  
  <p>Thanks for help</p>