Skip to content

Commit

Permalink
feat:support consul service update task. (#1357)
Browse files Browse the repository at this point in the history
  • Loading branch information
fuyuwei01 authored Jul 26, 2024
1 parent e023e02 commit 1d59307
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 9 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,5 @@
- [feat:add Tencent Cloud TSF support.](https://github.com/Tencent/spring-cloud-tencent/pull/1350)
- [feat:support consul config.](https://github.com/Tencent/spring-cloud-tencent/pull/1352)
- [feat:add trace report support.](https://github.com/Tencent/spring-cloud-tencent/pull/1353)
- [fix: fix lossless test case unstable issues.](https://github.com/Tencent/spring-cloud-tencent/pull/1355)
- [fix: fix lossless test case unstable issues.](https://github.com/Tencent/spring-cloud-tencent/pull/1355)
- [feat:support consul service update task.](https://github.com/Tencent/spring-cloud-tencent/pull/1357)
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,7 @@

package com.tencent.cloud.polaris.registry;

import com.tencent.cloud.common.metadata.MetadataContext;
import com.tencent.cloud.polaris.PolarisDiscoveryProperties;
import com.tencent.polaris.api.pojo.ServiceKey;
import com.tencent.polaris.assembly.api.AssemblyAPI;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
Expand Down Expand Up @@ -73,9 +71,6 @@ protected void register() {
LOGGER.debug("Registration disabled.");
return;
}
if (assemblyAPI != null) {
assemblyAPI.initService(new ServiceKey(MetadataContext.LOCAL_NAMESPACE, MetadataContext.LOCAL_SERVICE));
}
super.register();
}

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 @@ -74,7 +74,7 @@
<revision>1.14.0-2021.0.9-SNAPSHOT</revision>

<!-- Polaris SDK version -->
<polaris.version>1.15.7-SNAPSHOT</polaris.version>
<polaris.version>1.15.8-SNAPSHOT</polaris.version>

<!-- Dependencies -->
<guava.version>32.0.1-jre</guava.version>
Expand Down
12 changes: 11 additions & 1 deletion spring-cloud-tencent-examples/tsf-example/consumer-demo/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,17 @@
<dependencies>
<dependency>
<groupId>com.tencent.cloud</groupId>
<artifactId>spring-cloud-starter-tencent-all</artifactId>
<artifactId>spring-cloud-starter-tencent-polaris-discovery</artifactId>
</dependency>

<dependency>
<groupId>com.tencent.cloud</groupId>
<artifactId>spring-cloud-starter-tencent-polaris-config</artifactId>
</dependency>

<dependency>
<groupId>com.tencent.cloud</groupId>
<artifactId>spring-cloud-starter-tencent-polaris-contract</artifactId>
</dependency>

<dependency>
Expand Down
12 changes: 11 additions & 1 deletion spring-cloud-tencent-examples/tsf-example/provider-demo/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,17 @@
<dependencies>
<dependency>
<groupId>com.tencent.cloud</groupId>
<artifactId>spring-cloud-starter-tencent-all</artifactId>
<artifactId>spring-cloud-starter-tencent-polaris-discovery</artifactId>
</dependency>

<dependency>
<groupId>com.tencent.cloud</groupId>
<artifactId>spring-cloud-starter-tencent-polaris-config</artifactId>
</dependency>

<dependency>
<groupId>com.tencent.cloud</groupId>
<artifactId>spring-cloud-starter-tencent-polaris-contract</artifactId>
</dependency>

<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,9 @@ public void postProcessEnvironment(ConfigurableEnvironment environment, SpringAp
if (StringUtils.isBlank(tsfNamespaceId)) {
LOGGER.error("tsf_namespace_id is empty");
}
else {
defaultProperties.put("spring.cloud.polaris.namespace", tsfNamespaceId);
}

// tsf_consul_ip
String tsfConsulIp = environment.getProperty("tsf_consul_ip");
Expand Down

0 comments on commit 1d59307

Please sign in to comment.