Merge pull request #171 from SkyeBeFreeman/greenwich

fix:Turn off automatic injection of Polars rule.
pull/187/head
Haotian Zhang 3 years ago committed by GitHub
commit fb0fbd7357
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -7,3 +7,4 @@
- [feat:refactor loadbalancer module as a basic module for router and circuit breaker.](https://github.com/Tencent/spring-cloud-tencent/pull/166)
- [feat: override recover router config](https://github.com/Tencent/spring-cloud-tencent/pull/167)
- [fix:fix routes of gateway doesn't refresh bug.](https://github.com/Tencent/spring-cloud-tencent/pull/168)
- [fix:Turn off automatic injection of Polars rule.](https://github.com/Tencent/spring-cloud-tencent/pull/171)

@ -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

Loading…
Cancel
Save