From c27ef60a1b125c58d3701808df713b08a3398106 Mon Sep 17 00:00:00 2001 From: SkyeBeFreeman <928016560@qq.com> Date: Thu, 12 May 2022 11:48:05 +0800 Subject: [PATCH] fix:Turn off automatic injection of Polars rule. --- CHANGELOG.md | 3 ++- .../PolarisRibbonClientConfiguration.java | 24 +++++++++---------- 2 files changed, 13 insertions(+), 14 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6a9771825..28499dd51 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,5 @@ # Change Log --- -- [fix:fix routes of gateway doesn't refresh bug.](https://github.com/Tencent/spring-cloud-tencent/pull/158) \ No newline at end of file +- [fix:fix routes of gateway doesn't refresh bug.](https://github.com/Tencent/spring-cloud-tencent/pull/158) +- [fix:Turn off automatic injection of Polars rule.](https://github.com/Tencent/spring-cloud-tencent/pull/152) \ No newline at end of file diff --git a/spring-cloud-tencent-polaris-loadbalancer/src/main/java/com/tencent/cloud/polaris/loadbalancer/config/PolarisRibbonClientConfiguration.java b/spring-cloud-tencent-polaris-loadbalancer/src/main/java/com/tencent/cloud/polaris/loadbalancer/config/PolarisRibbonClientConfiguration.java index 3e84ed57f..3436a9ecb 100644 --- a/spring-cloud-tencent-polaris-loadbalancer/src/main/java/com/tencent/cloud/polaris/loadbalancer/config/PolarisRibbonClientConfiguration.java +++ b/spring-cloud-tencent-polaris-loadbalancer/src/main/java/com/tencent/cloud/polaris/loadbalancer/config/PolarisRibbonClientConfiguration.java @@ -24,8 +24,6 @@ import com.netflix.loadbalancer.IRule; import com.netflix.loadbalancer.Server; import com.netflix.loadbalancer.ServerList; import com.tencent.cloud.polaris.loadbalancer.PolarisLoadBalancer; -import com.tencent.cloud.polaris.loadbalancer.rule.PolarisLoadBalanceRule; -import com.tencent.cloud.polaris.loadbalancer.rule.PolarisWeightedRandomRule; import com.tencent.polaris.api.core.ConsumerAPI; import com.tencent.polaris.router.api.core.RouterAPI; @@ -41,17 +39,17 @@ import org.springframework.context.annotation.Configuration; @Configuration public class PolarisRibbonClientConfiguration { - @Bean - @ConditionalOnMissingBean - public IRule polarisRibbonRule( - PolarisLoadBalancerProperties polarisLoadBalancerProperties) { - switch (PolarisLoadBalanceRule - .fromStrategy(polarisLoadBalancerProperties.getStrategy())) { - case WEIGHTED_RANDOM_RULE: - default: - return new PolarisWeightedRandomRule(); - } - } +// @Bean +// @ConditionalOnMissingBean +// public IRule polarisRibbonRule( +// PolarisLoadBalancerProperties polarisLoadBalancerProperties) { +// switch (PolarisLoadBalanceRule +// .fromStrategy(polarisLoadBalancerProperties.getStrategy())) { +// case WEIGHTED_RANDOM_RULE: +// default: +// return new PolarisWeightedRandomRule(); +// } +// } @Bean @ConditionalOnMissingBean