From ef4829597ab094d40ea6298be20881b2e48d8e8a Mon Sep 17 00:00:00 2001 From: Fishtail <49390359+fuyuwei01@users.noreply.github.com> Date: Mon, 26 Aug 2024 21:39:50 +0800 Subject: [PATCH] fix: fix TSF context bootstrap configuration (#1395) --- CHANGELOG.md | 1 + .../context/tsf/consul/TsfConsulBootstrapConfiguration.java | 4 +--- .../context/tsf/env/TsfCoreEnvironmentPostProcessor.java | 3 ++- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0b597ab58..f75209710 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -30,3 +30,4 @@ - [feat:support TSF router.](https://github.com/Tencent/spring-cloud-tencent/pull/1368) - [feat:upgrade nearby router and add namespace nearby router.](https://github.com/Tencent/spring-cloud-tencent/pull/1371) - [fix:fix contract reporting bug when using TSF.](https://github.com/Tencent/spring-cloud-tencent/pull/1373) +- [fix: fix TSF context bootstrap configuration](https://github.com/Tencent/spring-cloud-tencent/pull/1395) \ No newline at end of file diff --git a/spring-cloud-tencent-polaris-context/src/main/java/com/tencent/cloud/polaris/context/tsf/consul/TsfConsulBootstrapConfiguration.java b/spring-cloud-tencent-polaris-context/src/main/java/com/tencent/cloud/polaris/context/tsf/consul/TsfConsulBootstrapConfiguration.java index 277b80f3a..594697a0c 100644 --- a/spring-cloud-tencent-polaris-context/src/main/java/com/tencent/cloud/polaris/context/tsf/consul/TsfConsulBootstrapConfiguration.java +++ b/spring-cloud-tencent-polaris-context/src/main/java/com/tencent/cloud/polaris/context/tsf/consul/TsfConsulBootstrapConfiguration.java @@ -17,13 +17,11 @@ package com.tencent.cloud.polaris.context.tsf.consul; -import com.tencent.cloud.polaris.context.config.PolarisContextAutoConfiguration; - import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Import; @Configuration(proxyBeanMethods = false) -@Import({PolarisContextAutoConfiguration.class, TsfConsulAutoConfiguration.class}) +@Import({TsfConsulAutoConfiguration.class}) public class TsfConsulBootstrapConfiguration { } diff --git a/spring-cloud-tencent-polaris-context/src/main/java/com/tencent/cloud/polaris/context/tsf/env/TsfCoreEnvironmentPostProcessor.java b/spring-cloud-tencent-polaris-context/src/main/java/com/tencent/cloud/polaris/context/tsf/env/TsfCoreEnvironmentPostProcessor.java index 135f5d9f7..6cfda6adf 100644 --- a/spring-cloud-tencent-polaris-context/src/main/java/com/tencent/cloud/polaris/context/tsf/env/TsfCoreEnvironmentPostProcessor.java +++ b/spring-cloud-tencent-polaris-context/src/main/java/com/tencent/cloud/polaris/context/tsf/env/TsfCoreEnvironmentPostProcessor.java @@ -59,7 +59,8 @@ public final class TsfCoreEnvironmentPostProcessor implements EnvironmentPostPro String tsfAppId = environment.getProperty("tsf_app_id"); if (StringUtils.isNotBlank(tsfAppId)) { Map defaultProperties = new HashMap<>(); - + // enable polaris as default + defaultProperties.put("spring.cloud.polaris.enabled", "true"); // tsf_application_id String tsfApplicationId = environment.getProperty("tsf_application_id"); if (StringUtils.isBlank(tsfApplicationId)) {