About Fatih Yilmaz

Passionate Java developer with a mindset for continuous learning and exploring new tech. When I'm not working I enjoy spending time with family, football, board games and non-fiction books.

Follow Fatih Yilmaz on LinkedIn

Posts by Fatih Yilmaz

How the default aspect order can break your resilience and caching strategy

Posted on by  
Fatih Yilmaz

While working on a Spring Boot 4 service using Java 25, I wanted to protect my external API calls as these can go down every now and then. For this I used Resilience4j @CircuitBreaker and @Retry annotations, and put a @Cacheable on top. Three annotations stacked on a single method, what could possibly go wrong?

It turns out that the order in which they are applied by default is probably not the one you want. This makes your circuit breaker count every retry attempt as a separate failure. And once the circuit opens it even blocks data that is sitting right there in your cache. Here is what happens by default, and how I changed it.

Continue reading →

shadow-left