JobServiceImpl.java:
@CircuitBreaker(name = "jobsApiServiceGetAllJobs", fallbackMethod = "getAllJobsFallback")
public ResponseEntity<JobsResponse> getAllJobs() {
...
throw new ApiException();
}
public ResponseEntity<JobsResponse> getAllJobsFallback(Throwable throwable) {
log.error("Fallback method called");
}
application.properties:
resilience4j.circuitbreaker.instances.jobsApiServiceGetAllJobs.ignoreExceptions=ccp.shared.platform.exception.ApiException,ccp.shared.platform.exception.BadRequestApiException
Whenever ccp.shared.platform.exception.ApiException
is thrown, the fallback method is called even though I have added it in the ignoreExceptions
list in the application.properties
file. I want it to not trigger the fallback method when ApiException
is thrown. I have tried similar questions on stack overflow and those does not work for me. Am I doing anything wrong?