Spring / Resilience4j Interview questions
How do you add Resilience4j to a Spring Boot project?
Add the Spring Boot starter for the modules you need - typically io.github.resilience4j:resilience4j-spring-boot3 for Spring Boot 3, plus Spring's own spring-boot-starter-aop, since Resilience4j's annotations rely on Spring AOP proxies to intercept calls.
<dependency> <groupId>io.github.resilience4j</groupId> <artifactId>resilience4j-spring-boot3</artifactId> <version>2.2.0</version> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-aop</artifactId> </dependency>
Once added, resilience patterns can be applied declaratively with annotations like @CircuitBreaker, @Retry, or @RateLimiter on any Spring-managed bean method, with the specific thresholds configured under a resilience4j.* section in application.yml.
More Related questions...