diff --git a/CHANGELOG.md b/CHANGELOG.md
index 5d8279670..3cae1b0e6 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -4,4 +4,5 @@
- [fix:fix log feign response stream close bug.](https://github.com/Tencent/spring-cloud-tencent/pull/897)
- [fix:remove the secondary report.](https://github.com/Tencent/spring-cloud-tencent/pull/899)
- [fix:optimize instance circuit beaker.](https://github.com/Tencent/spring-cloud-tencent/pull/909)
-- [fix:optimize multi service registration and discovery.](https://github.com/Tencent/spring-cloud-tencent/pull/912)
\ No newline at end of file
+- [fix:optimize multi service registration and discovery.](https://github.com/Tencent/spring-cloud-tencent/pull/912)
+- [feature: improve circuit breaker usage.](https://github.com/Tencent/spring-cloud-tencent/pull/913)
diff --git a/pom.xml b/pom.xml
index c8cd4eb03..5454486bf 100644
--- a/pom.xml
+++ b/pom.xml
@@ -91,7 +91,7 @@
1.11.0-2021.0.6-SNAPSHOT
- 5.3.26
+ 5.3.25
2.6.14
diff --git a/spring-cloud-starter-tencent-polaris-circuitbreaker/src/main/java/com/tencent/cloud/polaris/circuitbreaker/config/PolarisCircuitBreakerAutoConfiguration.java b/spring-cloud-starter-tencent-polaris-circuitbreaker/src/main/java/com/tencent/cloud/polaris/circuitbreaker/config/PolarisCircuitBreakerAutoConfiguration.java
index f838214f2..b2792737a 100644
--- a/spring-cloud-starter-tencent-polaris-circuitbreaker/src/main/java/com/tencent/cloud/polaris/circuitbreaker/config/PolarisCircuitBreakerAutoConfiguration.java
+++ b/spring-cloud-starter-tencent-polaris-circuitbreaker/src/main/java/com/tencent/cloud/polaris/circuitbreaker/config/PolarisCircuitBreakerAutoConfiguration.java
@@ -22,6 +22,7 @@ import java.util.List;
import com.tencent.cloud.polaris.circuitbreaker.PolarisCircuitBreakerFactory;
import com.tencent.cloud.polaris.circuitbreaker.common.CircuitBreakerConfigModifier;
+import com.tencent.cloud.polaris.circuitbreaker.resttemplate.PolarisCircuitBreakerRestTemplateBeanPostProcessor;
import com.tencent.cloud.rpc.enhancement.config.RpcEnhancementAutoConfiguration;
import com.tencent.cloud.rpc.enhancement.config.RpcEnhancementReporterProperties;
import com.tencent.polaris.circuitbreak.api.CircuitBreakAPI;
@@ -31,9 +32,11 @@ import com.tencent.polaris.client.api.SDKContext;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.AutoConfigureAfter;
import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
+import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.cloud.client.circuitbreaker.CircuitBreakerFactory;
import org.springframework.cloud.client.circuitbreaker.Customizer;
+import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
@@ -72,4 +75,11 @@ public class PolarisCircuitBreakerAutoConfiguration {
return new CircuitBreakerConfigModifier(properties);
}
+ @Bean
+ @ConditionalOnClass(name = "org.springframework.web.client.RestTemplate")
+ public static PolarisCircuitBreakerRestTemplateBeanPostProcessor polarisCircuitBreakerRestTemplateBeanPostProcessor(
+ ApplicationContext applicationContext) {
+ return new PolarisCircuitBreakerRestTemplateBeanPostProcessor(applicationContext);
+ }
+
}
diff --git a/spring-cloud-starter-tencent-polaris-circuitbreaker/src/main/java/com/tencent/cloud/polaris/circuitbreaker/config/PolarisCircuitBreakerBootstrapConfiguration.java b/spring-cloud-starter-tencent-polaris-circuitbreaker/src/main/java/com/tencent/cloud/polaris/circuitbreaker/config/PolarisCircuitBreakerBootstrapConfiguration.java
index c1cafea0b..6d6274253 100644
--- a/spring-cloud-starter-tencent-polaris-circuitbreaker/src/main/java/com/tencent/cloud/polaris/circuitbreaker/config/PolarisCircuitBreakerBootstrapConfiguration.java
+++ b/spring-cloud-starter-tencent-polaris-circuitbreaker/src/main/java/com/tencent/cloud/polaris/circuitbreaker/config/PolarisCircuitBreakerBootstrapConfiguration.java
@@ -28,7 +28,12 @@ import org.springframework.context.annotation.Import;
*/
@Configuration(proxyBeanMethods = false)
@ConditionalOnProperty("spring.cloud.polaris.enabled")
-@Import({PolarisCircuitBreakerAutoConfiguration.class, ReactivePolarisCircuitBreakerAutoConfiguration.class, PolarisCircuitBreakerFeignClientAutoConfiguration.class})
+@Import({
+ PolarisCircuitBreakerAutoConfiguration.class,
+ ReactivePolarisCircuitBreakerAutoConfiguration.class,
+ PolarisCircuitBreakerFeignClientAutoConfiguration.class,
+ GatewayPolarisCircuitBreakerAutoConfiguration.class
+})
public class PolarisCircuitBreakerBootstrapConfiguration {
}
diff --git a/spring-cloud-starter-tencent-polaris-circuitbreaker/src/main/java/com/tencent/cloud/polaris/circuitbreaker/config/PolarisCircuitBreakerFeignClientAutoConfiguration.java b/spring-cloud-starter-tencent-polaris-circuitbreaker/src/main/java/com/tencent/cloud/polaris/circuitbreaker/config/PolarisCircuitBreakerFeignClientAutoConfiguration.java
index 91096e1e6..57e25bcba 100644
--- a/spring-cloud-starter-tencent-polaris-circuitbreaker/src/main/java/com/tencent/cloud/polaris/circuitbreaker/config/PolarisCircuitBreakerFeignClientAutoConfiguration.java
+++ b/spring-cloud-starter-tencent-polaris-circuitbreaker/src/main/java/com/tencent/cloud/polaris/circuitbreaker/config/PolarisCircuitBreakerFeignClientAutoConfiguration.java
@@ -18,14 +18,20 @@
package com.tencent.cloud.polaris.circuitbreaker.config;
import com.tencent.cloud.polaris.circuitbreaker.feign.PolarisCircuitBreakerNameResolver;
+import com.tencent.cloud.polaris.circuitbreaker.feign.PolarisFeignCircuitBreaker;
+import com.tencent.cloud.polaris.circuitbreaker.feign.PolarisFeignCircuitBreakerTargeter;
import feign.Feign;
+import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
+import org.springframework.cloud.client.circuitbreaker.CircuitBreakerFactory;
import org.springframework.cloud.openfeign.CircuitBreakerNameResolver;
import org.springframework.cloud.openfeign.FeignClientFactoryBean;
+import org.springframework.cloud.openfeign.Targeter;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
+import org.springframework.context.annotation.Scope;
/**
* PolarisCircuitBreakerFeignClientAutoConfiguration.
@@ -43,4 +49,19 @@ public class PolarisCircuitBreakerFeignClientAutoConfiguration {
return new PolarisCircuitBreakerNameResolver();
}
+ @Bean
+ @ConditionalOnBean(CircuitBreakerFactory.class)
+ @ConditionalOnMissingBean(Targeter.class)
+ public Targeter polarisFeignCircuitBreakerTargeter(CircuitBreakerFactory circuitBreakerFactory, CircuitBreakerNameResolver circuitBreakerNameResolver) {
+ return new PolarisFeignCircuitBreakerTargeter(circuitBreakerFactory, circuitBreakerNameResolver);
+ }
+
+ @Bean
+ @Scope("prototype")
+ @ConditionalOnBean(CircuitBreakerFactory.class)
+ @ConditionalOnMissingBean(Feign.Builder.class)
+ public Feign.Builder circuitBreakerFeignBuilder() {
+ return PolarisFeignCircuitBreaker.builder();
+ }
+
}
diff --git a/spring-cloud-starter-tencent-polaris-circuitbreaker/src/main/java/com/tencent/cloud/polaris/circuitbreaker/config/ReactivePolarisCircuitBreakerAutoConfiguration.java b/spring-cloud-starter-tencent-polaris-circuitbreaker/src/main/java/com/tencent/cloud/polaris/circuitbreaker/config/ReactivePolarisCircuitBreakerAutoConfiguration.java
index 58ca348a5..9d9bf911e 100644
--- a/spring-cloud-starter-tencent-polaris-circuitbreaker/src/main/java/com/tencent/cloud/polaris/circuitbreaker/config/ReactivePolarisCircuitBreakerAutoConfiguration.java
+++ b/spring-cloud-starter-tencent-polaris-circuitbreaker/src/main/java/com/tencent/cloud/polaris/circuitbreaker/config/ReactivePolarisCircuitBreakerAutoConfiguration.java
@@ -60,7 +60,7 @@ public class ReactivePolarisCircuitBreakerAutoConfiguration {
@Bean
@ConditionalOnMissingBean(ReactiveCircuitBreakerFactory.class)
- public ReactiveCircuitBreakerFactory reactiveCircuitBreakerFactory(CircuitBreakAPI circuitBreakAPI) {
+ public ReactiveCircuitBreakerFactory polarisReactiveCircuitBreakerFactory(CircuitBreakAPI circuitBreakAPI) {
ReactivePolarisCircuitBreakerFactory factory = new ReactivePolarisCircuitBreakerFactory(circuitBreakAPI);
customizers.forEach(customizer -> customizer.customize(factory));
return factory;
diff --git a/spring-cloud-starter-tencent-polaris-circuitbreaker/src/main/java/com/tencent/cloud/polaris/circuitbreaker/feign/PolarisCircuitBreakerFallbackFactory.java b/spring-cloud-starter-tencent-polaris-circuitbreaker/src/main/java/com/tencent/cloud/polaris/circuitbreaker/feign/PolarisCircuitBreakerFallbackFactory.java
new file mode 100644
index 000000000..0bb6b9644
--- /dev/null
+++ b/spring-cloud-starter-tencent-polaris-circuitbreaker/src/main/java/com/tencent/cloud/polaris/circuitbreaker/feign/PolarisCircuitBreakerFallbackFactory.java
@@ -0,0 +1,97 @@
+/*
+ * Tencent is pleased to support the open source community by making Spring Cloud Tencent available.
+ *
+ * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved.
+ *
+ * Licensed under the BSD 3-Clause License (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://opensource.org/licenses/BSD-3-Clause
+ *
+ * Unless required by applicable law or agreed to in writing, software distributed
+ * under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
+ * CONDITIONS OF ANY KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations under the License.
+ */
+
+package com.tencent.cloud.polaris.circuitbreaker.feign;
+
+import java.io.IOException;
+import java.lang.reflect.Method;
+import java.nio.charset.StandardCharsets;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Map;
+
+import com.tencent.polaris.api.pojo.CircuitBreakerStatus;
+import com.tencent.polaris.circuitbreak.client.exception.CallAbortedException;
+import feign.Request;
+import feign.RequestTemplate;
+import feign.Response;
+import feign.codec.Decoder;
+
+import org.springframework.cloud.openfeign.FallbackFactory;
+
+/**
+ * PolarisCircuitBreakerFallbackFactory.
+ *
+ * @author sean yu
+ */
+public class PolarisCircuitBreakerFallbackFactory implements FallbackFactory {
+
+ private final Decoder decoder;
+
+ public PolarisCircuitBreakerFallbackFactory(Decoder decoder) {
+ this.decoder = decoder;
+ }
+
+ @Override
+ public Object create(Throwable t) {
+ return new DefaultFallback(t, decoder);
+ }
+
+ public class DefaultFallback {
+
+ private final Throwable t;
+
+ private final Decoder decoder;
+
+ public DefaultFallback(Throwable t, Decoder decoder) {
+ this.t = t;
+ this.decoder = decoder;
+ }
+
+ public Object fallback(Method method) {
+ if (t instanceof CallAbortedException) {
+ CircuitBreakerStatus.FallbackInfo fallbackInfo = ((CallAbortedException) t).getFallbackInfo();
+ if (fallbackInfo != null) {
+ Response.Builder responseBuilder = Response.builder()
+ .status(fallbackInfo.getCode());
+ if (fallbackInfo.getHeaders() != null) {
+ Map> headers = new HashMap<>();
+ fallbackInfo.getHeaders().forEach((k, v) -> headers.put(k, Collections.singleton(v)));
+ responseBuilder.headers(headers);
+ }
+ if (fallbackInfo.getBody() != null) {
+ responseBuilder.body(fallbackInfo.getBody(), StandardCharsets.UTF_8);
+ }
+ // Feign Response need a nonnull Request,
+ // which is not important in fallback response (no real request),
+ // so we create a fake one
+ Request fakeRequest = Request.create(Request.HttpMethod.GET, "/", new HashMap<>(), Request.Body.empty(), new RequestTemplate());
+ responseBuilder.request(fakeRequest);
+
+ try (Response response = responseBuilder.build()) {
+ return decoder.decode(response, method.getGenericReturnType());
+ }
+ catch (IOException e) {
+ throw new IllegalStateException(e);
+ }
+ }
+ }
+ throw new IllegalStateException(t);
+ }
+ }
+}
diff --git a/spring-cloud-starter-tencent-polaris-circuitbreaker/src/main/java/com/tencent/cloud/polaris/circuitbreaker/feign/PolarisCircuitBreakerNameResolver.java b/spring-cloud-starter-tencent-polaris-circuitbreaker/src/main/java/com/tencent/cloud/polaris/circuitbreaker/feign/PolarisCircuitBreakerNameResolver.java
index 2b1689c45..929a71d22 100644
--- a/spring-cloud-starter-tencent-polaris-circuitbreaker/src/main/java/com/tencent/cloud/polaris/circuitbreaker/feign/PolarisCircuitBreakerNameResolver.java
+++ b/spring-cloud-starter-tencent-polaris-circuitbreaker/src/main/java/com/tencent/cloud/polaris/circuitbreaker/feign/PolarisCircuitBreakerNameResolver.java
@@ -36,6 +36,7 @@ public class PolarisCircuitBreakerNameResolver implements CircuitBreakerNameReso
@Override
public String resolveCircuitBreakerName(String feignClientName, Target> target, Method method) {
+ String serviceName = target.name();
RequestMapping requestMapping = findMergedAnnotation(method, RequestMapping.class);
String path = "";
if (requestMapping != null) {
@@ -44,8 +45,8 @@ public class PolarisCircuitBreakerNameResolver implements CircuitBreakerNameReso
requestMapping.path()[0];
}
return "".equals(path) ?
- MetadataContext.LOCAL_NAMESPACE + "#" + feignClientName :
- MetadataContext.LOCAL_NAMESPACE + "#" + feignClientName + "#" + path;
+ MetadataContext.LOCAL_NAMESPACE + "#" + serviceName :
+ MetadataContext.LOCAL_NAMESPACE + "#" + serviceName + "#" + path;
}
}
diff --git a/spring-cloud-starter-tencent-polaris-circuitbreaker/src/main/java/com/tencent/cloud/polaris/circuitbreaker/feign/PolarisFeignCircuitBreaker.java b/spring-cloud-starter-tencent-polaris-circuitbreaker/src/main/java/com/tencent/cloud/polaris/circuitbreaker/feign/PolarisFeignCircuitBreaker.java
new file mode 100644
index 000000000..85eae2666
--- /dev/null
+++ b/spring-cloud-starter-tencent-polaris-circuitbreaker/src/main/java/com/tencent/cloud/polaris/circuitbreaker/feign/PolarisFeignCircuitBreaker.java
@@ -0,0 +1,94 @@
+/*
+ * Tencent is pleased to support the open source community by making Spring Cloud Tencent available.
+ *
+ * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved.
+ *
+ * Licensed under the BSD 3-Clause License (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://opensource.org/licenses/BSD-3-Clause
+ *
+ * Unless required by applicable law or agreed to in writing, software distributed
+ * under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
+ * CONDITIONS OF ANY KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations under the License.
+ */
+
+package com.tencent.cloud.polaris.circuitbreaker.feign;
+
+import feign.Feign;
+import feign.Target;
+
+import org.springframework.cloud.client.circuitbreaker.CircuitBreakerFactory;
+import org.springframework.cloud.openfeign.CircuitBreakerNameResolver;
+import org.springframework.cloud.openfeign.FallbackFactory;
+
+/**
+ * PolarisFeignCircuitBreaker, mostly copy from {@link org.springframework.cloud.openfeign.FeignCircuitBreaker}, but giving Polaris modification.
+ *
+ * @author sean yu
+ */
+public final class PolarisFeignCircuitBreaker {
+
+ private PolarisFeignCircuitBreaker() {
+ throw new IllegalStateException("Don't instantiate a utility class");
+ }
+
+ /**
+ * @return builder for Feign CircuitBreaker integration
+ */
+ public static PolarisFeignCircuitBreaker.Builder builder() {
+ return new PolarisFeignCircuitBreaker.Builder();
+ }
+
+ /**
+ * Builder for Feign CircuitBreaker integration.
+ */
+ public static final class Builder extends Feign.Builder {
+
+ public Builder() {
+ }
+
+ private CircuitBreakerFactory circuitBreakerFactory;
+
+ private String feignClientName;
+
+ private CircuitBreakerNameResolver circuitBreakerNameResolver;
+
+ public PolarisFeignCircuitBreaker.Builder circuitBreakerFactory(CircuitBreakerFactory circuitBreakerFactory) {
+ this.circuitBreakerFactory = circuitBreakerFactory;
+ return this;
+ }
+
+ public PolarisFeignCircuitBreaker.Builder feignClientName(String feignClientName) {
+ this.feignClientName = feignClientName;
+ return this;
+ }
+
+ public PolarisFeignCircuitBreaker.Builder circuitBreakerNameResolver(CircuitBreakerNameResolver circuitBreakerNameResolver) {
+ this.circuitBreakerNameResolver = circuitBreakerNameResolver;
+ return this;
+ }
+
+ public T target(Target target, T fallback) {
+ return build(fallback != null ? new FallbackFactory.Default(fallback) : null).newInstance(target);
+ }
+
+ public T target(Target target, FallbackFactory extends T> fallbackFactory) {
+ return build(fallbackFactory).newInstance(target);
+ }
+
+ @Override
+ public T target(Target target) {
+ return build(null).newInstance(target);
+ }
+
+ public Feign build(final FallbackFactory> nullableFallbackFactory) {
+ this.invocationHandlerFactory((target, dispatch) -> new PolarisFeignCircuitBreakerInvocationHandler(
+ circuitBreakerFactory, feignClientName, target, dispatch, nullableFallbackFactory, circuitBreakerNameResolver, this.decoder));
+ return this.build();
+ }
+
+ }
+}
diff --git a/spring-cloud-starter-tencent-polaris-circuitbreaker/src/main/java/com/tencent/cloud/polaris/circuitbreaker/feign/PolarisFeignCircuitBreakerInvocationHandler.java b/spring-cloud-starter-tencent-polaris-circuitbreaker/src/main/java/com/tencent/cloud/polaris/circuitbreaker/feign/PolarisFeignCircuitBreakerInvocationHandler.java
new file mode 100644
index 000000000..ab16bf625
--- /dev/null
+++ b/spring-cloud-starter-tencent-polaris-circuitbreaker/src/main/java/com/tencent/cloud/polaris/circuitbreaker/feign/PolarisFeignCircuitBreakerInvocationHandler.java
@@ -0,0 +1,200 @@
+/*
+ * Tencent is pleased to support the open source community by making Spring Cloud Tencent available.
+ *
+ * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved.
+ *
+ * Licensed under the BSD 3-Clause License (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://opensource.org/licenses/BSD-3-Clause
+ *
+ * Unless required by applicable law or agreed to in writing, software distributed
+ * under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
+ * CONDITIONS OF ANY KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations under the License.
+ */
+
+package com.tencent.cloud.polaris.circuitbreaker.feign;
+
+import java.lang.reflect.InvocationHandler;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.lang.reflect.Proxy;
+import java.util.LinkedHashMap;
+import java.util.Map;
+import java.util.function.Function;
+import java.util.function.Supplier;
+
+import feign.InvocationHandlerFactory;
+import feign.Target;
+import feign.codec.Decoder;
+
+import org.springframework.cloud.client.circuitbreaker.CircuitBreaker;
+import org.springframework.cloud.client.circuitbreaker.CircuitBreakerFactory;
+import org.springframework.cloud.client.circuitbreaker.NoFallbackAvailableException;
+import org.springframework.cloud.openfeign.CircuitBreakerNameResolver;
+import org.springframework.cloud.openfeign.FallbackFactory;
+import org.springframework.web.context.request.RequestAttributes;
+import org.springframework.web.context.request.RequestContextHolder;
+
+import static feign.Util.checkNotNull;
+
+/**
+ * PolarisFeignCircuitBreakerInvocationHandler, mostly copy from {@link org.springframework.cloud.openfeign.FeignCircuitBreakerInvocationHandler}, but giving Polaris modification.
+ *
+ * @author sean yu
+ */
+public class PolarisFeignCircuitBreakerInvocationHandler implements InvocationHandler {
+
+ private final CircuitBreakerFactory factory;
+
+ private final String feignClientName;
+
+ private final Target> target;
+
+ private final Map dispatch;
+
+ private final FallbackFactory> nullableFallbackFactory;
+
+ private final Map fallbackMethodMap;
+
+ private final CircuitBreakerNameResolver circuitBreakerNameResolver;
+
+ private final Decoder decoder;
+
+ public PolarisFeignCircuitBreakerInvocationHandler(CircuitBreakerFactory factory, String feignClientName, Target> target,
+ Map dispatch, FallbackFactory> nullableFallbackFactory,
+ CircuitBreakerNameResolver circuitBreakerNameResolver, Decoder decoder) {
+ this.factory = factory;
+ this.feignClientName = feignClientName;
+ this.target = checkNotNull(target, "target");
+ this.dispatch = checkNotNull(dispatch, "dispatch");
+ this.fallbackMethodMap = toFallbackMethod(dispatch);
+ this.nullableFallbackFactory = nullableFallbackFactory;
+ this.circuitBreakerNameResolver = circuitBreakerNameResolver;
+ this.decoder = decoder;
+ }
+
+ @Override
+ public Object invoke(final Object proxy, final Method method, final Object[] args) throws Throwable {
+ // early exit if the invoked method is from java.lang.Object
+ // code is the same as ReflectiveFeign.FeignInvocationHandler
+ if ("equals".equals(method.getName())) {
+ try {
+ Object otherHandler = args.length > 0 && args[0] != null ? Proxy.getInvocationHandler(args[0]) : null;
+ return equals(otherHandler);
+ }
+ catch (IllegalArgumentException e) {
+ return false;
+ }
+ }
+ else if ("hashCode".equals(method.getName())) {
+ return hashCode();
+ }
+ else if ("toString".equals(method.getName())) {
+ return toString();
+ }
+
+ String circuitName = circuitBreakerNameResolver.resolveCircuitBreakerName(feignClientName, target, method);
+ CircuitBreaker circuitBreaker = factory.create(circuitName);
+ Supplier