Commit 2886064c by Nepxion

修复Bug

parent 88f43e99
...@@ -11,7 +11,6 @@ package com.nepxion.discovery.plugin.framework.configuration; ...@@ -11,7 +11,6 @@ package com.nepxion.discovery.plugin.framework.configuration;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.AutoConfigureAfter; import org.springframework.boot.autoconfigure.AutoConfigureAfter;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.cloud.consul.discovery.ConsulDiscoveryProperties; import org.springframework.cloud.consul.discovery.ConsulDiscoveryProperties;
import org.springframework.cloud.consul.discovery.ConsulRibbonClientConfiguration; import org.springframework.cloud.consul.discovery.ConsulRibbonClientConfiguration;
import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Bean;
...@@ -37,7 +36,6 @@ public class ConsulLoadBalanceConfiguration { ...@@ -37,7 +36,6 @@ public class ConsulLoadBalanceConfiguration {
private ConsulClient client; private ConsulClient client;
@Bean @Bean
@ConditionalOnMissingBean
public ServerList<?> ribbonServerList(IClientConfig config, ConsulDiscoveryProperties properties) { public ServerList<?> ribbonServerList(IClientConfig config, ConsulDiscoveryProperties properties) {
ConsulServerListDecorator serverList = new ConsulServerListDecorator(client, properties); ConsulServerListDecorator serverList = new ConsulServerListDecorator(client, properties);
serverList.initWithNiwsConfig(config); serverList.initWithNiwsConfig(config);
......
...@@ -14,7 +14,6 @@ import javax.inject.Provider; ...@@ -14,7 +14,6 @@ import javax.inject.Provider;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.autoconfigure.AutoConfigureAfter; import org.springframework.boot.autoconfigure.AutoConfigureAfter;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.cloud.netflix.ribbon.PropertiesFactory; import org.springframework.cloud.netflix.ribbon.PropertiesFactory;
import org.springframework.cloud.netflix.ribbon.eureka.DomainExtractingServerList; import org.springframework.cloud.netflix.ribbon.eureka.DomainExtractingServerList;
import org.springframework.cloud.netflix.ribbon.eureka.EurekaRibbonClientConfiguration; import org.springframework.cloud.netflix.ribbon.eureka.EurekaRibbonClientConfiguration;
...@@ -47,7 +46,6 @@ public class EurekaLoadBalanceConfiguration { ...@@ -47,7 +46,6 @@ public class EurekaLoadBalanceConfiguration {
private LoadBalanceListenerExecutor loadBalanceListenerExecutor; private LoadBalanceListenerExecutor loadBalanceListenerExecutor;
@Bean @Bean
@ConditionalOnMissingBean
public ServerList<?> ribbonServerList(IClientConfig config, Provider<EurekaClient> eurekaClientProvider) { public ServerList<?> ribbonServerList(IClientConfig config, Provider<EurekaClient> eurekaClientProvider) {
if (this.propertiesFactory.isSet(ServerList.class, serviceId)) { if (this.propertiesFactory.isSet(ServerList.class, serviceId)) {
return this.propertiesFactory.get(ServerList.class, config, serviceId); return this.propertiesFactory.get(ServerList.class, config, serviceId);
......
...@@ -11,7 +11,6 @@ package com.nepxion.discovery.plugin.framework.configuration; ...@@ -11,7 +11,6 @@ package com.nepxion.discovery.plugin.framework.configuration;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.AutoConfigureAfter; import org.springframework.boot.autoconfigure.AutoConfigureAfter;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.cloud.zookeeper.discovery.ZookeeperRibbonClientConfiguration; import org.springframework.cloud.zookeeper.discovery.ZookeeperRibbonClientConfiguration;
import org.springframework.cloud.zookeeper.serviceregistry.ZookeeperServiceRegistry; import org.springframework.cloud.zookeeper.serviceregistry.ZookeeperServiceRegistry;
import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Bean;
...@@ -36,7 +35,6 @@ public class ZookeeperLoadBalanceConfiguration { ...@@ -36,7 +35,6 @@ public class ZookeeperLoadBalanceConfiguration {
private ZookeeperServiceRegistry registry; private ZookeeperServiceRegistry registry;
@Bean @Bean
@ConditionalOnMissingBean
public ServerList<?> ribbonServerList(IClientConfig config) { public ServerList<?> ribbonServerList(IClientConfig config) {
@SuppressWarnings("deprecation") @SuppressWarnings("deprecation")
ZookeeperServerListDecorator serverList = new ZookeeperServerListDecorator(this.registry.getServiceDiscoveryRef().get()); ZookeeperServerListDecorator serverList = new ZookeeperServerListDecorator(this.registry.getServiceDiscoveryRef().get());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment