fix:fix TypeNotPresentException in @ConditionalOnClass of router. (#276)

pull/280/head
Haotian Zhang 3 years ago committed by GitHub
parent be50a863ea
commit 6e2a3f1dc6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -10,3 +10,5 @@
- [change escape way into encode](https://github.com/Tencent/spring-cloud-tencent/pull/251) - [change escape way into encode](https://github.com/Tencent/spring-cloud-tencent/pull/251)
- [feat:support reading configuration from application.yml or application.properties.](https://github.com/Tencent/spring-cloud-tencent/pull/259) - [feat:support reading configuration from application.yml or application.properties.](https://github.com/Tencent/spring-cloud-tencent/pull/259)
- [fix:fix ClassNotFoundException while not importing openfeign when using circuit-breaker module.](https://github.com/Tencent/spring-cloud-tencent/pull/269) - [fix:fix ClassNotFoundException while not importing openfeign when using circuit-breaker module.](https://github.com/Tencent/spring-cloud-tencent/pull/269)
- [Update GitHub Actions workflow](https://github.com/Tencent/spring-cloud-tencent/pull/273)
- [fix:fix TypeNotPresentException in @ConditionalOnClass of router.](https://github.com/Tencent/spring-cloud-tencent/pull/276)

@ -27,8 +27,6 @@ import com.tencent.cloud.polaris.router.config.properties.PolarisNearByRouterPro
import com.tencent.cloud.polaris.router.config.properties.PolarisRuleBasedRouterProperties; import com.tencent.cloud.polaris.router.config.properties.PolarisRuleBasedRouterProperties;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.cloud.client.loadbalancer.LoadBalancerInterceptor;
import org.springframework.cloud.gateway.filter.LoadBalancerClientFilter;
import org.springframework.cloud.netflix.ribbon.RibbonClients; import org.springframework.cloud.netflix.ribbon.RibbonClients;
import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Configuration;
@ -49,14 +47,14 @@ public class RouterAutoConfiguration {
@Bean @Bean
@Order(HIGHEST_PRECEDENCE) @Order(HIGHEST_PRECEDENCE)
@ConditionalOnClass(LoadBalancerInterceptor.class) @ConditionalOnClass(name = "org.springframework.cloud.client.loadbalancer.LoadBalancerInterceptor")
public LoadBalancerInterceptorBeanPostProcessor loadBalancerInterceptorBeanPostProcessor() { public LoadBalancerInterceptorBeanPostProcessor loadBalancerInterceptorBeanPostProcessor() {
return new LoadBalancerInterceptorBeanPostProcessor(); return new LoadBalancerInterceptorBeanPostProcessor();
} }
@Bean @Bean
@Order(HIGHEST_PRECEDENCE) @Order(HIGHEST_PRECEDENCE)
@ConditionalOnClass(LoadBalancerClientFilter.class) @ConditionalOnClass(name = "org.springframework.cloud.gateway.filter.LoadBalancerClientFilter")
public LoadBalancerClientFilterBeanPostProcessor loadBalancerClientFilterBeanPostProcessor() { public LoadBalancerClientFilterBeanPostProcessor loadBalancerClientFilterBeanPostProcessor() {
return new LoadBalancerClientFilterBeanPostProcessor(); return new LoadBalancerClientFilterBeanPostProcessor();
} }

Loading…
Cancel
Save