Я использую resilience4j с SpringBoot. Я вижу, что аннотации resilience4j работают, только если они размещены в классе, который выдает исключение. Если класс расширяется другим классом, а родительский класс имеет аннотацию, повторные попытки не работают.
Resilience4j Config
resilience4j.retry:
instances:
service:
maxRetryAttempts: 5
waitDuration: 1000
retryException:
- com.common.exception.RetriableException
Родительский класс
@Retry(name = "service")
@Component
public class httpClient extends client{
// This method is invoked from outside
public HttpResponse<T> getResponse(
String url, Class<T> responseType) {
return super.getResponse(url, requestEntity, responseType);
}
}
Детский класс
@Retry(name = "service") // Without this line, the retries don't work, even though it is present in the parent class
@Component
public class client{
public HttpResponse<T> getResponse(
String url, Class<T> responseType) {
//Impl which throws RetriableException
}
}
Это ожидаемое поведение? Можете ли вы дать мне знать, если я что-то упустил