|
|
@ -113,10 +113,11 @@ public class PolarisFeignCircuitBreakerInvocationHandler implements InvocationHa
|
|
|
|
else if ("toString".equals(method.getName())) {
|
|
|
|
else if ("toString".equals(method.getName())) {
|
|
|
|
return toString();
|
|
|
|
return toString();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Supplier<Object> supplier = asSupplier(method, args);
|
|
|
|
|
|
|
|
if (circuitBreakerNameResolver != null) {
|
|
|
|
String circuitName = circuitBreakerNameResolver.resolveCircuitBreakerName(feignClientName, target, method);
|
|
|
|
String circuitName = circuitBreakerNameResolver.resolveCircuitBreakerName(feignClientName, target, method);
|
|
|
|
CircuitBreaker circuitBreaker = factory.create(circuitName);
|
|
|
|
CircuitBreaker circuitBreaker = factory.create(circuitName);
|
|
|
|
Supplier<Object> supplier = asSupplier(method, args);
|
|
|
|
|
|
|
|
Function<Throwable, Object> fallbackFunction;
|
|
|
|
Function<Throwable, Object> fallbackFunction;
|
|
|
|
if (this.nullableFallbackFactory != null) {
|
|
|
|
if (this.nullableFallbackFactory != null) {
|
|
|
|
fallbackFunction = throwable -> {
|
|
|
|
fallbackFunction = throwable -> {
|
|
|
@ -145,6 +146,10 @@ public class PolarisFeignCircuitBreakerInvocationHandler implements InvocationHa
|
|
|
|
throw e.getCause();
|
|
|
|
throw e.getCause();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
else {
|
|
|
|
|
|
|
|
return supplier.get();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void unwrapAndRethrow(Exception exception) {
|
|
|
|
private void unwrapAndRethrow(Exception exception) {
|
|
|
|
if (exception instanceof InvocationTargetException || exception instanceof NoFallbackAvailableException) {
|
|
|
|
if (exception instanceof InvocationTargetException || exception instanceof NoFallbackAvailableException) {
|
|
|
|