Merge branch 'greenwich' into g/router_example

pull/108/head
lepdou 3 years ago committed by GitHub
commit 162a4b777d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -5,9 +5,9 @@ name: Test with Junit
on:
push:
branches: [ greenwich-new ]
branches: [ greenwich ]
pull_request:
branches: [ greenwich-new ]
branches: [ greenwich ]
jobs:
build:

@ -1,8 +1,7 @@
# Change Log
---
- [Bugfix: fix router bug and add router example](https://github.com/Tencent/spring-cloud-tencent/pull/108)
- [feat:fix discovery weight param not set to register request bug](https://github.com/Tencent/spring-cloud-tencent/pull/103)
- [Bugfix: fix causing cpu 100% when set ScheduledThreadPoolExecutor corePoolSize=0](https://github.com/Tencent/spring-cloud-tencent/pull/99)

@ -0,0 +1,19 @@
# Change Log
---
- [the server address only support one ip](https://github.com/Tencent/spring-cloud-tencent/pull/36)
- [feature: get service list by given namespace](https://github.com/Tencent/spring-cloud-tencent/pull/38)
- [feat:Support multi-discovery server.](https://github.com/Tencent/spring-cloud-tencent/pull/42)
- [fix:fix [Deserialization of Untrusted Data in logback]](https://github.com/Tencent/spring-cloud-tencent/pull/44/files)
- [feat:support customize registered ip address.](https://github.com/Tencent/spring-cloud-tencent/pull/47)
- [fix:fix import default log implement error](https://github.com/Tencent/spring-cloud-tencent/pull/53)
- [send heartbeat if healthcheck url not configured](https://github.com/Tencent/spring-cloud-tencent/pull/54)
- [feat:optimize project structure and checkstyle](https://github.com/Tencent/spring-cloud-tencent/pull/56)
- [feat:divide storage and transfer of metadata.](https://github.com/Tencent/spring-cloud-tencent/pull/63)
- [feat:support polaris config center.](https://github.com/Tencent/spring-cloud-tencent/pull/69)
- [feat:optimize metadata module.](https://github.com/Tencent/spring-cloud-tencent/pull/70)
- [feat: optimize pom dependency and demo](https://github.com/Tencent/spring-cloud-tencent/pull/71)
- [feat:upgrade polaris version to 1.3.0.](https://github.com/Tencent/spring-cloud-tencent/pull/72)
- [feat:rollback init polaris-context to application phase](https://github.com/Tencent/spring-cloud-tencent/pull/73)
- [feat:tencent-commons add spring-cloud-starter dependency](https://github.com/Tencent/spring-cloud-tencent/pull/76)
- [fix:fix fetching wrong PEER_SERVICE in SCG filter.](https://github.com/Tencent/spring-cloud-tencent/pull/83)

@ -77,7 +77,7 @@
<properties>
<!-- Project revision -->
<revision>1.2.0-Greenwich</revision>
<revision>1.3.0-Greenwich-SNAPSHOT</revision>
<!-- Spring Cloud -->
<spring.cloud.version>Greenwich.SR6</spring.cloud.version>

@ -56,7 +56,7 @@ public class PolarisDiscoveryProperties {
* Load balance weight.
*/
@Value("${spring.cloud.polaris.discovery.weight:#{100}}")
private float weight;
private int weight;
/**
* Version number.
@ -134,11 +134,11 @@ public class PolarisDiscoveryProperties {
this.namespace = namespace;
}
public float getWeight() {
public int getWeight() {
return weight;
}
public void setWeight(float weight) {
public void setWeight(int weight) {
this.weight = weight;
}

@ -18,8 +18,8 @@
package com.tencent.cloud.polaris.registry;
import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.ScheduledThreadPoolExecutor;
import java.util.concurrent.TimeUnit;
import com.tencent.cloud.common.metadata.config.MetadataLocalProperties;
@ -71,13 +71,11 @@ public class PolarisServiceRegistry implements ServiceRegistry<Registration> {
this.polarisDiscoveryProperties = polarisDiscoveryProperties;
this.polarisDiscoveryHandler = polarisDiscoveryHandler;
this.metadataLocalProperties = metadataLocalProperties;
if (polarisDiscoveryProperties.isHeartbeatEnabled()) {
ScheduledThreadPoolExecutor heartbeatExecutor = new ScheduledThreadPoolExecutor(
0, new NamedThreadFactory("spring-cloud-heartbeat"));
heartbeatExecutor.setMaximumPoolSize(1);
this.heartbeatExecutor = heartbeatExecutor;
}
else {
this.heartbeatExecutor = Executors
.newSingleThreadScheduledExecutor(new NamedThreadFactory("spring-cloud-heartbeat"));
} else {
this.heartbeatExecutor = null;
}
}
@ -95,6 +93,7 @@ public class PolarisServiceRegistry implements ServiceRegistry<Registration> {
instanceRegisterRequest.setService(registration.getServiceId());
instanceRegisterRequest.setHost(registration.getHost());
instanceRegisterRequest.setPort(registration.getPort());
instanceRegisterRequest.setWeight(polarisDiscoveryProperties.getWeight());
instanceRegisterRequest.setToken(polarisDiscoveryProperties.getToken());
if (null != heartbeatExecutor) {
instanceRegisterRequest.setTtl(ttl);

@ -50,7 +50,7 @@
},
{
"name": "spring.cloud.polaris.weight",
"type": "java.lang.String",
"type": "java.lang.Integer",
"defaultValue": 100,
"description": "the weight of polaris instance , use to load-balance."
}

@ -62,7 +62,7 @@
</developers>
<properties>
<revision>1.2.0-Greenwich</revision>
<revision>1.3.0-Greenwich-SNAPSHOT</revision>
<polaris.version>1.3.1</polaris.version>
<!-- Dependencies -->

Loading…
Cancel
Save