fix:fix nearby router properties loading bug. (#1381)

Co-authored-by: Haotian Zhang <skyebefreeman@qq.com>
pull/1382/head
Fishtail 4 months ago committed by GitHub
parent 36a71ac862
commit c45b04ff4f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -9,3 +9,4 @@
- [feat: support lane router](https://github.com/Tencent/spring-cloud-tencent/pull/1378) - [feat: support lane router](https://github.com/Tencent/spring-cloud-tencent/pull/1378)
- [feat: add lane router examples](https://github.com/Tencent/spring-cloud-tencent/pull/1379) - [feat: add lane router examples](https://github.com/Tencent/spring-cloud-tencent/pull/1379)
- [fix: fix the lossless provider override in multiple registries scenario](https://github.com/Tencent/spring-cloud-tencent/pull/1380) - [fix: fix the lossless provider override in multiple registries scenario](https://github.com/Tencent/spring-cloud-tencent/pull/1380)
- [fix:fix nearby router properties loading bug.](https://github.com/Tencent/spring-cloud-tencent/pull/1381)

@ -45,7 +45,6 @@ import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.cloud.loadbalancer.annotation.LoadBalancerClients; import org.springframework.cloud.loadbalancer.annotation.LoadBalancerClients;
import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;
import org.springframework.core.annotation.Order; import org.springframework.core.annotation.Order;
import org.springframework.http.client.ClientHttpRequestInterceptor; import org.springframework.http.client.ClientHttpRequestInterceptor;
import org.springframework.web.client.RestTemplate; import org.springframework.web.client.RestTemplate;
@ -60,7 +59,6 @@ import static org.springframework.core.Ordered.HIGHEST_PRECEDENCE;
@Configuration(proxyBeanMethods = false) @Configuration(proxyBeanMethods = false)
@ConditionalOnPolarisRouterEnabled @ConditionalOnPolarisRouterEnabled
@LoadBalancerClients(defaultConfiguration = LoadBalancerConfiguration.class) @LoadBalancerClients(defaultConfiguration = LoadBalancerConfiguration.class)
@Import({PolarisNearByRouterProperties.class, PolarisMetadataRouterProperties.class, PolarisRuleBasedRouterProperties.class})
public class RouterAutoConfiguration { public class RouterAutoConfiguration {
@Bean @Bean

@ -19,11 +19,14 @@
package com.tencent.cloud.polaris.router.config; package com.tencent.cloud.polaris.router.config;
import com.tencent.cloud.polaris.router.RouterConfigModifier; import com.tencent.cloud.polaris.router.RouterConfigModifier;
import com.tencent.cloud.polaris.router.config.properties.PolarisMetadataRouterProperties;
import com.tencent.cloud.polaris.router.config.properties.PolarisNearByRouterProperties; import com.tencent.cloud.polaris.router.config.properties.PolarisNearByRouterProperties;
import com.tencent.cloud.polaris.router.config.properties.PolarisRuleBasedRouterProperties;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;
/** /**
* RouterConfigModifierAutoConfiguration. * RouterConfigModifierAutoConfiguration.
@ -32,6 +35,7 @@ import org.springframework.context.annotation.Configuration;
*/ */
@Configuration(proxyBeanMethods = false) @Configuration(proxyBeanMethods = false)
@ConditionalOnPolarisRouterEnabled @ConditionalOnPolarisRouterEnabled
@Import({PolarisNearByRouterProperties.class, PolarisMetadataRouterProperties.class, PolarisRuleBasedRouterProperties.class})
public class RouterConfigModifierAutoConfiguration { public class RouterConfigModifierAutoConfiguration {
@Bean @Bean

@ -39,6 +39,7 @@ public class FeignAutoConfigurationTest {
.withConfiguration(AutoConfigurations.of( .withConfiguration(AutoConfigurations.of(
MetadataAutoConfiguration.class, MetadataAutoConfiguration.class,
RouterAutoConfiguration.class, RouterAutoConfiguration.class,
RouterConfigModifierAutoConfiguration.class,
PolarisContextAutoConfiguration.class, PolarisContextAutoConfiguration.class,
FeignAutoConfiguration.class, FeignAutoConfiguration.class,
ApplicationContextAwareUtils.class ApplicationContextAwareUtils.class

@ -42,6 +42,7 @@ public class RouterAutoConfigurationTests {
TestRestTemplatesConfiguration.class, TestRestTemplatesConfiguration.class,
MetadataAutoConfiguration.class, MetadataAutoConfiguration.class,
RouterAutoConfiguration.class, RouterAutoConfiguration.class,
RouterConfigModifierAutoConfiguration.class,
RouterBootstrapAutoConfiguration.class, RouterBootstrapAutoConfiguration.class,
PolarisContextAutoConfiguration.class, PolarisContextAutoConfiguration.class,
RouterAutoConfiguration.RouterLabelRestTemplateConfig.class, RouterAutoConfiguration.RouterLabelRestTemplateConfig.class,

@ -74,7 +74,7 @@
<revision>1.14.0-2020.0.6-SNAPSHOT</revision> <revision>1.14.0-2020.0.6-SNAPSHOT</revision>
<!-- Polaris SDK version --> <!-- Polaris SDK version -->
<polaris.version>1.15.4-SNAPSHOT</polaris.version> <polaris.version>1.15.5-SNAPSHOT</polaris.version>
<!-- Dependencies --> <!-- Dependencies -->
<guava.version>32.0.1-jre</guava.version> <guava.version>32.0.1-jre</guava.version>

Loading…
Cancel
Save