1
0
mirror of https://gitee.com/mirrors/Spring-Cloud-Alibaba.git synced 2021-06-26 13:25:11 +08:00

seata feignloadbalancer enhance

This commit is contained in:
yuhuangbin 2020-01-15 22:08:52 +08:00
parent 648944df09
commit ab06f3232c
2 changed files with 1 additions and 14 deletions

View File

@ -20,10 +20,6 @@
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-openfeign</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-loadbalancer</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-netflix-hystrix</artifactId>

View File

@ -41,8 +41,6 @@ public class SeataFeignObjectWrapper {
private SpringClientFactory springClientFactory;
private BlockingLoadBalancerClient loadBalancerClient;
SeataFeignObjectWrapper(BeanFactory beanFactory) {
this.beanFactory = beanFactory;
}
@ -57,7 +55,7 @@ public class SeataFeignObjectWrapper {
if (bean.getClass().getName().equals(
"org.springframework.cloud.openfeign.loadbalancer.FeignBlockingLoadBalancerClient")) {
return new SeataFeignBlockingLoadBalancerClient(getClient(bean),
loadBalancerClient());
beanFactory.getBean(BlockingLoadBalancerClient.class));
}
return new SeataFeignClient(this.beanFactory, (Client) bean);
}
@ -82,13 +80,6 @@ public class SeataFeignObjectWrapper {
return null;
}
private BlockingLoadBalancerClient loadBalancerClient() {
if (this.loadBalancerClient != null) {
return this.loadBalancerClient;
}
return beanFactory.getBean(BlockingLoadBalancerClient.class);
}
CachingSpringLoadBalancerFactory factory() {
if (this.cachingSpringLoadBalancerFactory == null) {
this.cachingSpringLoadBalancerFactory = this.beanFactory