Skip to content

Commit

Permalink
fix:fix config rebinder bean conflict.
Browse files Browse the repository at this point in the history
  • Loading branch information
SkyeBeFreeman committed Feb 14, 2023
1 parent eb883c7 commit 9cbe8e9
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion README-zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ Spring Cloud Tencent 所有组件都已上传到 Maven 中央仓库,只需要
<groupId>com.tencent.cloud</groupId>
<artifactId>spring-cloud-tencent-dependencies</artifactId>
<!--version number-->
<version>1.9.0-2020.0.5</version>
<version>1.9.1-2020.0.5</version>
<type>pom</type>
<scope>import</scope>
</dependency>
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ For example:
<groupId>com.tencent.cloud</groupId>
<artifactId>spring-cloud-tencent-dependencies</artifactId>
<!--version number-->
<version>1.9.0-2020.0.5</version>
<version>1.9.1-2020.0.5</version>
<type>pom</type>
<scope>import</scope>
</dependency>
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@

<properties>
<!-- Project revision -->
<revision>1.9.0-2020.0.5</revision>
<revision>1.9.1-2020.0.5</revision>

<!-- Spring Cloud -->
<spring.cloud.version>2020.0.5</spring.cloud.version>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
import org.springframework.cloud.context.refresh.ContextRefresher;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Primary;

/**
* polaris config module auto configuration at init application context phase.
Expand All @@ -60,7 +61,7 @@ public PolarisConfigChangeEventListener polarisConfigChangeEventListener() {
}

@Bean
@ConditionalOnMissingBean(search = SearchStrategy.CURRENT)
@Primary
@ConditionalOnReflectRefreshType
public ConfigurationPropertiesRebinder affectedConfigurationPropertiesRebinder(
ConfigurationPropertiesBeans beans) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ public void springValueFiledProcessorTest() {
.withConfiguration(AutoConfigurations.of(RefreshAutoConfiguration.class))
.withConfiguration(AutoConfigurations.of(ValueTest.class))
.withConfiguration(AutoConfigurations.of(PolarisConfigAutoConfiguration.class))
.withAllowBeanDefinitionOverriding(true)
.withPropertyValues("spring.application.name=" + "conditionalOnConfigReflectEnabledTest")
.withPropertyValues("spring.cloud.polaris.address=grpc://127.0.0.1:10081")
.withPropertyValues("spring.cloud.polaris.config.refresh-type=" + RefreshType.REFLECT)
Expand Down Expand Up @@ -114,6 +115,7 @@ public void springValueMethodProcessorTest() {
.withConfiguration(AutoConfigurations.of(RefreshAutoConfiguration.class))
.withConfiguration(AutoConfigurations.of(ValueTest.class))
.withConfiguration(AutoConfigurations.of(PolarisConfigAutoConfiguration.class))
.withAllowBeanDefinitionOverriding(true)
.withPropertyValues("spring.application.name=" + "conditionalOnConfigReflectEnabledTest")
.withPropertyValues("spring.cloud.polaris.address=grpc://127.0.0.1:10081")
.withPropertyValues("spring.cloud.polaris.config.refresh-type=" + RefreshType.REFLECT)
Expand Down Expand Up @@ -147,6 +149,7 @@ public void xmlBeamDefinitionTest() {
.withConfiguration(AutoConfigurations.of(RefreshAutoConfiguration.class))
.withConfiguration(AutoConfigurations.of(XMLBeamDefinitionTest.class))
.withConfiguration(AutoConfigurations.of(PolarisConfigAutoConfiguration.class))
.withAllowBeanDefinitionOverriding(true)
.withPropertyValues("spring.application.name=" + "conditionalOnConfigReflectEnabledTest")
.withPropertyValues("spring.cloud.polaris.address=grpc://127.0.0.1:10081")
.withPropertyValues("spring.cloud.polaris.config.refresh-type=" + RefreshType.REFLECT)
Expand Down
2 changes: 1 addition & 1 deletion spring-cloud-tencent-dependencies/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
</developers>

<properties>
<revision>1.9.0-2020.0.5</revision>
<revision>1.9.1-2020.0.5</revision>

<!-- Dependencies -->
<polaris.version>1.10.5</polaris.version>
Expand Down

0 comments on commit 9cbe8e9

Please sign in to comment.