mirror of
https://gitee.com/mirrors/Spring-Cloud-Alibaba.git
synced 2021-06-26 13:25:11 +08:00
remote all hystrix,zuul,ribbon
This commit is contained in:
@@ -38,14 +38,6 @@ import org.springframework.context.annotation.Scope;
|
||||
@AutoConfigureBefore(FeignAutoConfiguration.class)
|
||||
public class SeataFeignClientAutoConfiguration {
|
||||
|
||||
// @Bean
|
||||
// @Scope("prototype")
|
||||
// @ConditionalOnClass(name = "com.netflix.hystrix.HystrixCommand")
|
||||
// @ConditionalOnProperty(name = "feign.hystrix.enabled", havingValue = "true")
|
||||
// Feign.Builder feignHystrixBuilder(BeanFactory beanFactory) {
|
||||
// return SeataHystrixFeignBuilder.builder(beanFactory);
|
||||
// }
|
||||
|
||||
@Bean
|
||||
@Scope("prototype")
|
||||
@ConditionalOnClass(name = "com.alibaba.csp.sentinel.SphU")
|
||||
|
@@ -24,10 +24,7 @@ import org.springframework.beans.factory.BeanFactory;
|
||||
import org.springframework.cloud.client.loadbalancer.LoadBalancerProperties;
|
||||
import org.springframework.cloud.loadbalancer.blocking.client.BlockingLoadBalancerClient;
|
||||
import org.springframework.cloud.loadbalancer.support.LoadBalancerClientFactory;
|
||||
//import org.springframework.cloud.netflix.ribbon.SpringClientFactory;
|
||||
import org.springframework.cloud.openfeign.loadbalancer.FeignBlockingLoadBalancerClient;
|
||||
//import org.springframework.cloud.openfeign.ribbon.CachingSpringLoadBalancerFactory;
|
||||
//import org.springframework.cloud.openfeign.ribbon.LoadBalancerFeignClient;
|
||||
|
||||
/**
|
||||
* @author xiaojing
|
||||
@@ -39,9 +36,6 @@ public class SeataFeignObjectWrapper {
|
||||
|
||||
private final BeanFactory beanFactory;
|
||||
|
||||
// private CachingSpringLoadBalancerFactory cachingSpringLoadBalancerFactory;
|
||||
|
||||
// private SpringClientFactory springClientFactory;
|
||||
|
||||
SeataFeignObjectWrapper(BeanFactory beanFactory) {
|
||||
this.beanFactory = beanFactory;
|
||||
@@ -49,11 +43,6 @@ public class SeataFeignObjectWrapper {
|
||||
|
||||
Object wrap(Object bean) {
|
||||
if (bean instanceof Client && !(bean instanceof SeataFeignClient)) {
|
||||
// if (bean instanceof LoadBalancerFeignClient) {
|
||||
// LoadBalancerFeignClient client = ((LoadBalancerFeignClient) bean);
|
||||
// return new SeataLoadBalancerFeignClient(client.getDelegate(), factory(),
|
||||
// clientFactory(), this);
|
||||
// }
|
||||
if (bean instanceof FeignBlockingLoadBalancerClient) {
|
||||
FeignBlockingLoadBalancerClient client = (FeignBlockingLoadBalancerClient) bean;
|
||||
return new SeataFeignBlockingLoadBalancerClient(client.getDelegate(),
|
||||
@@ -66,21 +55,4 @@ public class SeataFeignObjectWrapper {
|
||||
}
|
||||
return bean;
|
||||
}
|
||||
|
||||
// CachingSpringLoadBalancerFactory factory() {
|
||||
// if (this.cachingSpringLoadBalancerFactory == null) {
|
||||
// this.cachingSpringLoadBalancerFactory = this.beanFactory
|
||||
// .getBean(CachingSpringLoadBalancerFactory.class);
|
||||
// }
|
||||
// return this.cachingSpringLoadBalancerFactory;
|
||||
// }
|
||||
|
||||
// SpringClientFactory clientFactory() {
|
||||
// if (this.springClientFactory == null) {
|
||||
// this.springClientFactory = this.beanFactory
|
||||
// .getBean(SpringClientFactory.class);
|
||||
// }
|
||||
// return this.springClientFactory;
|
||||
// }
|
||||
|
||||
}
|
||||
|
@@ -1,38 +0,0 @@
|
||||
///*
|
||||
// * Copyright 2013-2018 the original author or authors.
|
||||
// *
|
||||
// * Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// * you may not use this file except in compliance with the License.
|
||||
// * You may obtain a copy of the License at
|
||||
// *
|
||||
// * https://www.apache.org/licenses/LICENSE-2.0
|
||||
// *
|
||||
// * 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.alibaba.cloud.seata.feign;
|
||||
//
|
||||
//import feign.Feign;
|
||||
//import feign.Retryer;
|
||||
//import feign.hystrix.HystrixFeign;
|
||||
//
|
||||
//import org.springframework.beans.factory.BeanFactory;
|
||||
//
|
||||
///**
|
||||
// * @author xiaojing
|
||||
// */
|
||||
//final class SeataHystrixFeignBuilder {
|
||||
//
|
||||
// private SeataHystrixFeignBuilder() {
|
||||
// }
|
||||
//
|
||||
// static Feign.Builder builder(BeanFactory beanFactory) {
|
||||
// return HystrixFeign.builder().retryer(Retryer.NEVER_RETRY)
|
||||
// .client(new SeataFeignClient(beanFactory));
|
||||
// }
|
||||
//
|
||||
//}
|
@@ -1,45 +0,0 @@
|
||||
///*
|
||||
// * Copyright 2013-2018 the original author or authors.
|
||||
// *
|
||||
// * Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// * you may not use this file except in compliance with the License.
|
||||
// * You may obtain a copy of the License at
|
||||
// *
|
||||
// * https://www.apache.org/licenses/LICENSE-2.0
|
||||
// *
|
||||
// * 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.alibaba.cloud.seata.feign;
|
||||
//
|
||||
//import java.io.IOException;
|
||||
//
|
||||
//import feign.Client;
|
||||
//import feign.Request;
|
||||
//import feign.Response;
|
||||
//
|
||||
//
|
||||
///**
|
||||
// * @author xiaojing
|
||||
// * @author yuhuangbin
|
||||
// */
|
||||
//public class SeataLoadBalancerFeignClient extends LoadBalancerFeignClient {
|
||||
//
|
||||
// SeataLoadBalancerFeignClient(Client delegate,
|
||||
// CachingSpringLoadBalancerFactory lbClientFactory,
|
||||
// SpringClientFactory clientFactory,
|
||||
// SeataFeignObjectWrapper seataFeignObjectWrapper) {
|
||||
// super((Client) seataFeignObjectWrapper.wrap(delegate), lbClientFactory,
|
||||
// clientFactory);
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public Response execute(Request request, Request.Options options) throws IOException {
|
||||
// return super.execute(request, options);
|
||||
// }
|
||||
//
|
||||
//}
|
Reference in New Issue
Block a user