From fcacb92414c572a505a93423b41baf54c82121c0 Mon Sep 17 00:00:00 2001 From: lepdou Date: Wed, 13 Apr 2022 14:50:06 +0800 Subject: [PATCH] optimize router dependency --- CHANGELOG.md | 1 + .../pom.xml | 52 +++++++++++++++++++ .../pom.xml | 30 +++++++++++ .../pom.xml | 30 +++++++++++ .../polaris/ribbon/PolarisServerList.java | 2 +- .../pom.xml | 30 +++++++++++ .../pom.xml | 50 +++++++++++++++++- .../discovery-caller-service/pom.xml | 7 +-- spring-cloud-tencent-polaris-context/pom.xml | 24 ++------- 9 files changed, 198 insertions(+), 28 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 50f9bacfc..43308b127 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,3 +5,4 @@ - [feat:add custom label resolver spi for rate limit](https://github.com/Tencent/spring-cloud-tencent/pull/106) - [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) +- [Feat: optimize router dependency](https://github.com/Tencent/spring-cloud-tencent/pull/114) diff --git a/spring-cloud-starter-tencent-polaris-circuitbreaker/pom.xml b/spring-cloud-starter-tencent-polaris-circuitbreaker/pom.xml index 14b825713..a76c72d0d 100644 --- a/spring-cloud-starter-tencent-polaris-circuitbreaker/pom.xml +++ b/spring-cloud-starter-tencent-polaris-circuitbreaker/pom.xml @@ -24,11 +24,63 @@ com.tencent.polaris polaris-discovery-factory + + + com.tencent.polaris + router-rule + + + com.tencent.polaris + router-nearby + + + com.tencent.polaris + router-metadata + + + com.tencent.polaris + router-canary + + + com.tencent.polaris + router-set + + com.tencent.polaris polaris-circuitbreaker-factory + + + com.tencent.polaris + router-rule + + + com.tencent.polaris + router-nearby + + + com.tencent.polaris + router-metadata + + + com.tencent.polaris + router-canary + + + com.tencent.polaris + router-set + + + com.tencent.polaris + router-isolated + + + com.tencent.polaris + router-healthy + + diff --git a/spring-cloud-starter-tencent-polaris-config/pom.xml b/spring-cloud-starter-tencent-polaris-config/pom.xml index d257cd08e..10b362a67 100644 --- a/spring-cloud-starter-tencent-polaris-config/pom.xml +++ b/spring-cloud-starter-tencent-polaris-config/pom.xml @@ -24,6 +24,36 @@ com.tencent.polaris polaris-configuration-factory + + + com.tencent.polaris + router-rule + + + com.tencent.polaris + router-nearby + + + com.tencent.polaris + router-metadata + + + com.tencent.polaris + router-canary + + + com.tencent.polaris + router-set + + + com.tencent.polaris + router-isolated + + + com.tencent.polaris + router-healthy + + diff --git a/spring-cloud-starter-tencent-polaris-discovery/pom.xml b/spring-cloud-starter-tencent-polaris-discovery/pom.xml index 2ab637140..71ae069b1 100644 --- a/spring-cloud-starter-tencent-polaris-discovery/pom.xml +++ b/spring-cloud-starter-tencent-polaris-discovery/pom.xml @@ -25,6 +25,36 @@ com.tencent.polaris polaris-discovery-factory + + + com.tencent.polaris + router-rule + + + com.tencent.polaris + router-nearby + + + com.tencent.polaris + router-metadata + + + com.tencent.polaris + router-canary + + + com.tencent.polaris + router-set + + + com.tencent.polaris + router-isolated + + + com.tencent.polaris + router-healthy + + diff --git a/spring-cloud-starter-tencent-polaris-discovery/src/main/java/com/tencent/cloud/polaris/ribbon/PolarisServerList.java b/spring-cloud-starter-tencent-polaris-discovery/src/main/java/com/tencent/cloud/polaris/ribbon/PolarisServerList.java index 4ab2ae02a..15d72323f 100644 --- a/spring-cloud-starter-tencent-polaris-discovery/src/main/java/com/tencent/cloud/polaris/ribbon/PolarisServerList.java +++ b/spring-cloud-starter-tencent-polaris-discovery/src/main/java/com/tencent/cloud/polaris/ribbon/PolarisServerList.java @@ -56,7 +56,7 @@ public class PolarisServerList extends AbstractServerList { } private List getServers() { - InstancesResponse allInstances = polarisDiscoveryHandler.getInstances(serviceId); + InstancesResponse allInstances = polarisDiscoveryHandler.getFilteredInstances(serviceId); ServiceInstances serviceInstances = allInstances.toServiceInstances(); List polarisServers = new ArrayList<>(); for (Instance instance : serviceInstances.getInstances()) { diff --git a/spring-cloud-starter-tencent-polaris-ratelimit/pom.xml b/spring-cloud-starter-tencent-polaris-ratelimit/pom.xml index e3886ecf2..a313fb962 100644 --- a/spring-cloud-starter-tencent-polaris-ratelimit/pom.xml +++ b/spring-cloud-starter-tencent-polaris-ratelimit/pom.xml @@ -25,6 +25,36 @@ com.tencent.polaris polaris-ratelimit-factory + + + com.tencent.polaris + router-rule + + + com.tencent.polaris + router-nearby + + + com.tencent.polaris + router-metadata + + + com.tencent.polaris + router-canary + + + com.tencent.polaris + router-set + + + com.tencent.polaris + router-isolated + + + com.tencent.polaris + router-healthy + + diff --git a/spring-cloud-starter-tencent-polaris-router/pom.xml b/spring-cloud-starter-tencent-polaris-router/pom.xml index cffa4f084..0bf38eec6 100644 --- a/spring-cloud-starter-tencent-polaris-router/pom.xml +++ b/spring-cloud-starter-tencent-polaris-router/pom.xml @@ -25,11 +25,52 @@ com.tencent.polaris polaris-router-factory + + + com.tencent.polaris + router-rule + + + com.tencent.polaris + router-nearby + + + com.tencent.polaris + router-metadata + + + com.tencent.polaris + router-canary + + + com.tencent.polaris + router-set + + + com.tencent.polaris + router-isolated + + + com.tencent.polaris + router-healthy + + + - org.springframework.cloud - spring-cloud-starter-netflix-ribbon + com.tencent.polaris + router-rule + + + + com.tencent.polaris + router-nearby + + + + com.tencent.polaris + router-metadata @@ -39,6 +80,11 @@ + + org.springframework.cloud + spring-cloud-starter-netflix-ribbon + + org.springframework.boot spring-boot-starter-test diff --git a/spring-cloud-tencent-examples/polaris-discovery-example/discovery-caller-service/pom.xml b/spring-cloud-tencent-examples/polaris-discovery-example/discovery-caller-service/pom.xml index c8bfaf0cf..fd2eed66a 100644 --- a/spring-cloud-tencent-examples/polaris-discovery-example/discovery-caller-service/pom.xml +++ b/spring-cloud-tencent-examples/polaris-discovery-example/discovery-caller-service/pom.xml @@ -32,11 +32,6 @@ - - - com.tencent.cloud - spring-cloud-starter-tencent-polaris-router - @@ -66,4 +61,4 @@ - \ No newline at end of file + diff --git a/spring-cloud-tencent-polaris-context/pom.xml b/spring-cloud-tencent-polaris-context/pom.xml index 5f0845a75..03bd9b212 100644 --- a/spring-cloud-tencent-polaris-context/pom.xml +++ b/spring-cloud-tencent-polaris-context/pom.xml @@ -57,6 +57,7 @@ flow-cache-expired + com.tencent.polaris router-isolated @@ -67,25 +68,10 @@ router-healthy - - com.tencent.polaris - router-rule - - - - com.tencent.polaris - router-nearby - - - - com.tencent.polaris - router-metadata - - - - com.tencent.polaris - loadbalancer-random - + + com.tencent.polaris + loadbalancer-random + com.tencent.polaris