diff --git a/sop-common/sop-bridge-gateway/src/main/java/com/gitee/sop/bridge/SopGatewayAutoConfiguration.java b/sop-common/sop-bridge-gateway/src/main/java/com/gitee/sop/bridge/SopGatewayAutoConfiguration.java index e454f0a1..98184616 100644 --- a/sop-common/sop-bridge-gateway/src/main/java/com/gitee/sop/bridge/SopGatewayAutoConfiguration.java +++ b/sop-common/sop-bridge-gateway/src/main/java/com/gitee/sop/bridge/SopGatewayAutoConfiguration.java @@ -1,6 +1,8 @@ package com.gitee.sop.bridge; import com.gitee.sop.gatewaycommon.gateway.configuration.AlipayGatewayConfiguration; +import org.springframework.boot.autoconfigure.AutoConfigureBefore; +import org.springframework.cloud.netflix.ribbon.RibbonAutoConfiguration; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Import; @@ -10,5 +12,6 @@ import org.springframework.context.annotation.Import; */ @Configuration @Import(AlipayGatewayConfiguration.class) +@AutoConfigureBefore(RibbonAutoConfiguration.class) public class SopGatewayAutoConfiguration { } diff --git a/sop-common/sop-bridge-gateway/src/main/resources/sop-bridge.properties b/sop-common/sop-bridge-gateway/src/main/resources/sop-bridge.properties index 0627a28d..115692b7 100644 --- a/sop-common/sop-bridge-gateway/src/main/resources/sop-bridge.properties +++ b/sop-common/sop-bridge-gateway/src/main/resources/sop-bridge.properties @@ -6,8 +6,6 @@ sop.secret=MZZOUSTua6LzApIWXCwEgbBmxSzpzC # 网关入口 sop.gateway-index-path=/ -spring.main.allow-bean-definition-overriding=true - # nacos cloud配置 spring.cloud.nacos.discovery.server-addr=${nacos.url} diff --git a/sop-common/sop-gateway-common/src/main/java/com/gitee/sop/gatewaycommon/gateway/configuration/BaseGatewayConfiguration.java b/sop-common/sop-gateway-common/src/main/java/com/gitee/sop/gatewaycommon/gateway/configuration/BaseGatewayConfiguration.java index 9c1d356f..815ff647 100644 --- a/sop-common/sop-gateway-common/src/main/java/com/gitee/sop/gatewaycommon/gateway/configuration/BaseGatewayConfiguration.java +++ b/sop-common/sop-gateway-common/src/main/java/com/gitee/sop/gatewaycommon/gateway/configuration/BaseGatewayConfiguration.java @@ -123,9 +123,8 @@ public class BaseGatewayConfiguration extends AbstractConfiguration { * @param clientFactory * @return */ - @Primary @Bean - LoadBalancerClient sopLoadBalancerClient(SpringClientFactory clientFactory) { + LoadBalancerClient loadBalancerClient(SpringClientFactory clientFactory) { return new SopLoadBalancerClient(clientFactory); } @@ -135,7 +134,6 @@ public class BaseGatewayConfiguration extends AbstractConfiguration { * @param loadBalancerProperties loadBalancerProperties * @return */ - @Primary @Bean LoadBalancerClientFilter loadBalancerClientFilter(LoadBalancerClient sopLoadBalancerClient, LoadBalancerProperties loadBalancerProperties) { return new SopLoadBalancerClientFilter(sopLoadBalancerClient, loadBalancerProperties);