From d1b052f0729b17eece2a4cc9740877571a4c26f2 Mon Sep 17 00:00:00 2001 From: Fishtail <49390359+fuyuwei01@users.noreply.github.com> Date: Tue, 20 Aug 2024 17:02:54 +0800 Subject: [PATCH] fix:fix contract reporting bug when using TSF. (#1406) Co-authored-by: Haotian Zhang --- CHANGELOG.md | 1 + .../src/main/resources/META-INF/spring.factories | 4 +++- .../polaris/contract/config/PolarisContractProperties.java | 6 ------ .../cloud/polaris/contract/tsf/TsfContractProperties.java | 2 +- 4 files changed, 5 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 28de37d6f..760e5d752 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -26,3 +26,4 @@ - [feat: support otel trace](https://github.com/Tencent/spring-cloud-tencent/pull/1402) - [feat:support TSF router.](https://github.com/Tencent/spring-cloud-tencent/pull/1403) - [feat:upgrade nearby router and add namespace nearby router.](https://github.com/Tencent/spring-cloud-tencent/pull/1404) +- [fix:fix contract reporting bug when using TSF.](https://github.com/Tencent/spring-cloud-tencent/pull/1406) diff --git a/spring-cloud-starter-tencent-polaris-config/src/main/resources/META-INF/spring.factories b/spring-cloud-starter-tencent-polaris-config/src/main/resources/META-INF/spring.factories index 10aa4fc37..cf037fffd 100644 --- a/spring-cloud-starter-tencent-polaris-config/src/main/resources/META-INF/spring.factories +++ b/spring-cloud-starter-tencent-polaris-config/src/main/resources/META-INF/spring.factories @@ -1,7 +1,9 @@ org.springframework.boot.autoconfigure.EnableAutoConfiguration=\ com.tencent.cloud.polaris.config.tsf.PolarisAdaptorTsfConfigAutoConfiguration,\ com.tencent.cloud.polaris.config.PolarisConfigAutoConfiguration,\ - com.tencent.cloud.polaris.config.endpoint.PolarisConfigEndpointAutoConfiguration + com.tencent.cloud.polaris.config.PolarisConfigBootstrapAutoConfiguration,\ + com.tencent.cloud.polaris.config.endpoint.PolarisConfigEndpointAutoConfiguration,\ + com.tencent.cloud.polaris.config.tsf.PolarisAdaptorTsfConfigBootstrapConfiguration org.springframework.cloud.bootstrap.BootstrapConfiguration=\ com.tencent.cloud.polaris.config.PolarisConfigBootstrapAutoConfiguration,\ com.tencent.cloud.polaris.config.tsf.PolarisAdaptorTsfConfigBootstrapConfiguration diff --git a/spring-cloud-starter-tencent-polaris-contract/src/main/java/com/tencent/cloud/polaris/contract/config/PolarisContractProperties.java b/spring-cloud-starter-tencent-polaris-contract/src/main/java/com/tencent/cloud/polaris/contract/config/PolarisContractProperties.java index 3f698288d..b297fb0d0 100644 --- a/spring-cloud-starter-tencent-polaris-contract/src/main/java/com/tencent/cloud/polaris/contract/config/PolarisContractProperties.java +++ b/spring-cloud-starter-tencent-polaris-contract/src/main/java/com/tencent/cloud/polaris/contract/config/PolarisContractProperties.java @@ -161,17 +161,11 @@ public class PolarisContractProperties implements ContractProperties { @Override public boolean isReportEnabled() { - if (Objects.nonNull(extendContractProperties)) { - return extendContractProperties.isReportEnabled(); - } return reportEnabled; } @Override public void setReportEnabled(boolean reportEnabled) { - if (Objects.nonNull(extendContractProperties)) { - extendContractProperties.setReportEnabled(reportEnabled); - } this.reportEnabled = reportEnabled; } diff --git a/spring-cloud-starter-tencent-polaris-contract/src/main/java/com/tencent/cloud/polaris/contract/tsf/TsfContractProperties.java b/spring-cloud-starter-tencent-polaris-contract/src/main/java/com/tencent/cloud/polaris/contract/tsf/TsfContractProperties.java index 997bfbc1d..64cd71051 100644 --- a/spring-cloud-starter-tencent-polaris-contract/src/main/java/com/tencent/cloud/polaris/contract/tsf/TsfContractProperties.java +++ b/spring-cloud-starter-tencent-polaris-contract/src/main/java/com/tencent/cloud/polaris/contract/tsf/TsfContractProperties.java @@ -56,7 +56,7 @@ public class TsfContractProperties implements ExtendedContractProperties { @Override public boolean isEnabled() { - return false; + return enabled; } @Override