diff --git a/CHANGELOG.md b/CHANGELOG.md index a900b8058..1364a41c3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,19 +1,8 @@ # 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) -- [fix:fix junit not working bug.](https://github.com/Tencent/spring-cloud-tencent/pull/96) + + + +- [Bugfix: fix router bug and add router example](https://github.com/Tencent/spring-cloud-tencent/pull/109) diff --git a/spring-cloud-starter-tencent-polaris-discovery/src/main/java/com/tencent/cloud/polaris/discovery/PolarisServiceDiscovery.java b/spring-cloud-starter-tencent-polaris-discovery/src/main/java/com/tencent/cloud/polaris/discovery/PolarisServiceDiscovery.java index ccaf2f370..29b0d3052 100644 --- a/spring-cloud-starter-tencent-polaris-discovery/src/main/java/com/tencent/cloud/polaris/discovery/PolarisServiceDiscovery.java +++ b/spring-cloud-starter-tencent-polaris-discovery/src/main/java/com/tencent/cloud/polaris/discovery/PolarisServiceDiscovery.java @@ -49,7 +49,7 @@ public class PolarisServiceDiscovery { */ public List getInstances(String serviceId) throws PolarisException { List instances = new ArrayList<>(); - InstancesResponse filteredInstances = polarisDiscoveryHandler.getFilteredInstances(serviceId); + InstancesResponse filteredInstances = polarisDiscoveryHandler.getInstances(serviceId); ServiceInstances serviceInstances = filteredInstances.toServiceInstances(); for (Instance instance : serviceInstances.getInstances()) { instances.add(new PolarisServiceInstance(instance)); diff --git a/spring-cloud-starter-tencent-polaris-router/src/main/java/com/tencent/cloud/polaris/router/PolarisRouterServiceInstanceListSupplier.java b/spring-cloud-starter-tencent-polaris-router/src/main/java/com/tencent/cloud/polaris/router/PolarisRouterServiceInstanceListSupplier.java index d7134e352..b9866d5df 100644 --- a/spring-cloud-starter-tencent-polaris-router/src/main/java/com/tencent/cloud/polaris/router/PolarisRouterServiceInstanceListSupplier.java +++ b/spring-cloud-starter-tencent-polaris-router/src/main/java/com/tencent/cloud/polaris/router/PolarisRouterServiceInstanceListSupplier.java @@ -78,7 +78,7 @@ public class PolarisRouterServiceInstanceListSupplier extends DelegatingServiceI "PolarisRoutingLoadBalancer only Server with AppName or ServiceIdForDiscovery attribute"); } ServiceKey serviceKey = new ServiceKey(MetadataContext.LOCAL_NAMESPACE, serviceName); - List instances = new ArrayList<>(8); + List instances = new ArrayList<>(allServers.size()); for (ServiceInstance server : allServers) { DefaultInstance instance = new DefaultInstance(); instance.setNamespace(MetadataContext.LOCAL_NAMESPACE); @@ -88,6 +88,7 @@ public class PolarisRouterServiceInstanceListSupplier extends DelegatingServiceI instance.setHost(server.getHost()); instance.setPort(server.getPort()); instance.setWeight(100); + instance.setMetadata(server.getMetadata()); instances.add(instance); } serviceInstances = new DefaultServiceInstances(serviceKey, instances); diff --git a/spring-cloud-starter-tencent-polaris-router/src/main/java/com/tencent/cloud/polaris/router/config/PolarisLoadBalancerClientConfiguration.java b/spring-cloud-starter-tencent-polaris-router/src/main/java/com/tencent/cloud/polaris/router/config/PolarisLoadBalancerClientConfiguration.java index deebb19f5..371df6450 100644 --- a/spring-cloud-starter-tencent-polaris-router/src/main/java/com/tencent/cloud/polaris/router/config/PolarisLoadBalancerClientConfiguration.java +++ b/spring-cloud-starter-tencent-polaris-router/src/main/java/com/tencent/cloud/polaris/router/config/PolarisLoadBalancerClientConfiguration.java @@ -71,7 +71,6 @@ public class PolarisLoadBalancerClientConfiguration { @Bean @ConditionalOnBean(ReactiveDiscoveryClient.class) - @ConditionalOnMissingBean @ConditionalOnProperty(value = "spring.cloud.loadbalancer.configurations", havingValue = "polaris") public ServiceInstanceListSupplier polarisRouterDiscoveryClientServiceInstanceListSupplier(RouterAPI routerAPI, ConfigurableApplicationContext context) { @@ -88,7 +87,6 @@ public class PolarisLoadBalancerClientConfiguration { @Bean @ConditionalOnBean(DiscoveryClient.class) - @ConditionalOnMissingBean @ConditionalOnProperty(value = "spring.cloud.loadbalancer.configurations", havingValue = "polaris") public ServiceInstanceListSupplier polarisRouterDiscoveryClientServiceInstanceListSupplier(RouterAPI routerAPI, ConfigurableApplicationContext context) { diff --git a/spring-cloud-tencent-examples/polaris-router-example/pom.xml b/spring-cloud-tencent-examples/polaris-router-example/pom.xml new file mode 100644 index 000000000..37e8aee34 --- /dev/null +++ b/spring-cloud-tencent-examples/polaris-router-example/pom.xml @@ -0,0 +1,39 @@ + + + + spring-cloud-tencent-examples + com.tencent.cloud + ${revision} + ../pom.xml + + 4.0.0 + + polaris-router-example + pom + + + router-callee-service1 + router-callee-service2 + router-caller-service + + + + + org.springframework.boot + spring-boot-starter-web + + + + org.springframework.boot + spring-boot-starter-actuator + + + + org.springframework.cloud + spring-cloud-starter-openfeign + + + + diff --git a/spring-cloud-tencent-examples/polaris-router-example/router-callee-service1/pom.xml b/spring-cloud-tencent-examples/polaris-router-example/router-callee-service1/pom.xml new file mode 100644 index 000000000..253d3739a --- /dev/null +++ b/spring-cloud-tencent-examples/polaris-router-example/router-callee-service1/pom.xml @@ -0,0 +1,50 @@ + + + + polaris-router-example + com.tencent.cloud + ${revision} + ../pom.xml + + 4.0.0 + + router-callee-service1 + + + + com.tencent.cloud + spring-cloud-starter-tencent-polaris-discovery + + + + + + + org.springframework.boot + spring-boot-maven-plugin + + + + repackage + + + + + + org.apache.maven.plugins + maven-source-plugin + 3.2.0 + + + attach-sources + + jar + + + + + + + diff --git a/spring-cloud-tencent-examples/polaris-router-example/router-callee-service1/src/main/java/com/tencent/cloud/polaris/router/example/RouterCalleeApplication1.java b/spring-cloud-tencent-examples/polaris-router-example/router-callee-service1/src/main/java/com/tencent/cloud/polaris/router/example/RouterCalleeApplication1.java new file mode 100644 index 000000000..4692d6847 --- /dev/null +++ b/spring-cloud-tencent-examples/polaris-router-example/router-callee-service1/src/main/java/com/tencent/cloud/polaris/router/example/RouterCalleeApplication1.java @@ -0,0 +1,34 @@ +/* + * Tencent is pleased to support the open source community by making Spring Cloud Tencent available. + * + * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. + * + * Licensed under the BSD 3-Clause License (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://opensource.org/licenses/BSD-3-Clause + * + * Unless required by applicable law or agreed to in writing, software distributed + * under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR + * CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + * + */ + +package com.tencent.cloud.polaris.router.example; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; + +/** + * Router callee application. + *@author lepdou 2022-04-06 + */ +@SpringBootApplication +public class RouterCalleeApplication1 { + + public static void main(String[] args) { + SpringApplication.run(RouterCalleeApplication1.class, args); + } +} diff --git a/spring-cloud-tencent-examples/polaris-router-example/router-callee-service1/src/main/java/com/tencent/cloud/polaris/router/example/RouterCalleeController.java b/spring-cloud-tencent-examples/polaris-router-example/router-callee-service1/src/main/java/com/tencent/cloud/polaris/router/example/RouterCalleeController.java new file mode 100644 index 000000000..4a9f19394 --- /dev/null +++ b/spring-cloud-tencent-examples/polaris-router-example/router-callee-service1/src/main/java/com/tencent/cloud/polaris/router/example/RouterCalleeController.java @@ -0,0 +1,52 @@ +/* + * Tencent is pleased to support the open source community by making Spring Cloud Tencent available. + * + * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. + * + * Licensed under the BSD 3-Clause License (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://opensource.org/licenses/BSD-3-Clause + * + * Unless required by applicable law or agreed to in writing, software distributed + * under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR + * CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + * + */ + +package com.tencent.cloud.polaris.router.example; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import org.springframework.beans.factory.annotation.Value; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * Discovery callee controller. + * + * @author lepdou 2022-04-06 + */ +@RestController +@RequestMapping("/router/service/callee") +public class RouterCalleeController { + + private static Logger LOG = LoggerFactory.getLogger(RouterCalleeController.class); + + @Value("${server.port:0}") + private int port; + + /** + * Get information of callee. + * @return information of callee + */ + @GetMapping("/info") + public String info() { + LOG.info("Discovery Service Callee [{}] is called.", port); + return String.format("Discovery Service Callee [%s] is called.", port); + } +} diff --git a/spring-cloud-tencent-examples/polaris-router-example/router-callee-service1/src/main/resources/bootstrap.yml b/spring-cloud-tencent-examples/polaris-router-example/router-callee-service1/src/main/resources/bootstrap.yml new file mode 100644 index 000000000..1d352ec85 --- /dev/null +++ b/spring-cloud-tencent-examples/polaris-router-example/router-callee-service1/src/main/resources/bootstrap.yml @@ -0,0 +1,13 @@ +server: + port: 48081 +spring: + application: + name: RouterCalleeService + cloud: + tencent: + metadata: + content: + label1: value1 + polaris: + address: grpc://127.0.0.1:8091 + namespace: default diff --git a/spring-cloud-tencent-examples/polaris-router-example/router-callee-service2/pom.xml b/spring-cloud-tencent-examples/polaris-router-example/router-callee-service2/pom.xml new file mode 100644 index 000000000..0dd00a788 --- /dev/null +++ b/spring-cloud-tencent-examples/polaris-router-example/router-callee-service2/pom.xml @@ -0,0 +1,50 @@ + + + + polaris-router-example + com.tencent.cloud + ${revision} + ../pom.xml + + 4.0.0 + + router-callee-service2 + + + + com.tencent.cloud + spring-cloud-starter-tencent-polaris-discovery + + + + + + + org.springframework.boot + spring-boot-maven-plugin + + + + repackage + + + + + + org.apache.maven.plugins + maven-source-plugin + 3.2.0 + + + attach-sources + + jar + + + + + + + diff --git a/spring-cloud-tencent-examples/polaris-router-example/router-callee-service2/src/main/java/com/tencent/cloud/polaris/router/example/RouterCalleeApplication2.java b/spring-cloud-tencent-examples/polaris-router-example/router-callee-service2/src/main/java/com/tencent/cloud/polaris/router/example/RouterCalleeApplication2.java new file mode 100644 index 000000000..5f0bc6300 --- /dev/null +++ b/spring-cloud-tencent-examples/polaris-router-example/router-callee-service2/src/main/java/com/tencent/cloud/polaris/router/example/RouterCalleeApplication2.java @@ -0,0 +1,34 @@ +/* + * Tencent is pleased to support the open source community by making Spring Cloud Tencent available. + * + * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. + * + * Licensed under the BSD 3-Clause License (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://opensource.org/licenses/BSD-3-Clause + * + * Unless required by applicable law or agreed to in writing, software distributed + * under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR + * CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + * + */ + +package com.tencent.cloud.polaris.router.example; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; + +/** + * Router callee application. + * @author lepdou 2022-04-06 + */ +@SpringBootApplication +public class RouterCalleeApplication2 { + + public static void main(String[] args) { + SpringApplication.run(RouterCalleeApplication2.class, args); + } +} diff --git a/spring-cloud-tencent-examples/polaris-router-example/router-callee-service2/src/main/java/com/tencent/cloud/polaris/router/example/RouterCalleeController.java b/spring-cloud-tencent-examples/polaris-router-example/router-callee-service2/src/main/java/com/tencent/cloud/polaris/router/example/RouterCalleeController.java new file mode 100644 index 000000000..f02f1887d --- /dev/null +++ b/spring-cloud-tencent-examples/polaris-router-example/router-callee-service2/src/main/java/com/tencent/cloud/polaris/router/example/RouterCalleeController.java @@ -0,0 +1,53 @@ +/* + * Tencent is pleased to support the open source community by making Spring Cloud Tencent available. + * + * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. + * + * Licensed under the BSD 3-Clause License (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://opensource.org/licenses/BSD-3-Clause + * + * Unless required by applicable law or agreed to in writing, software distributed + * under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR + * CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + * + */ + +package com.tencent.cloud.polaris.router.example; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import org.springframework.beans.factory.annotation.Value; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * Discovery callee controller. + * + * @author lepdou 2022-04-06 + */ +@RestController +@RequestMapping("/router/service/callee") +public class RouterCalleeController { + + private static Logger LOG = LoggerFactory.getLogger(RouterCalleeController.class); + + @Value("${server.port:0}") + private int port; + + /** + * Get information of callee. + * @return information of callee + */ + @GetMapping("/info") + public String info() { + LOG.info("Discovery Service Callee [{}] is called.", port); + return String.format("Discovery Service Callee [%s] is called.", port); + } + +} diff --git a/spring-cloud-tencent-examples/polaris-router-example/router-callee-service2/src/main/resources/bootstrap.yml b/spring-cloud-tencent-examples/polaris-router-example/router-callee-service2/src/main/resources/bootstrap.yml new file mode 100644 index 000000000..138c119f6 --- /dev/null +++ b/spring-cloud-tencent-examples/polaris-router-example/router-callee-service2/src/main/resources/bootstrap.yml @@ -0,0 +1,13 @@ +server: + port: 48082 +spring: + application: + name: RouterCalleeService + cloud: + tencent: + metadata: + content: + label1: value2 + polaris: + address: grpc://127.0.0.1:8091 + namespace: default diff --git a/spring-cloud-tencent-examples/polaris-router-example/router-caller-service/pom.xml b/spring-cloud-tencent-examples/polaris-router-example/router-caller-service/pom.xml new file mode 100644 index 000000000..8a1af3407 --- /dev/null +++ b/spring-cloud-tencent-examples/polaris-router-example/router-caller-service/pom.xml @@ -0,0 +1,56 @@ + + + + polaris-router-example + com.tencent.cloud + ${revision} + ../pom.xml + + 4.0.0 + + router-caller-service + + + + com.tencent.cloud + spring-cloud-starter-tencent-polaris-discovery + + + + com.tencent.cloud + spring-cloud-starter-tencent-polaris-router + + + + + + + org.springframework.boot + spring-boot-maven-plugin + + + + repackage + + + + + + org.apache.maven.plugins + maven-source-plugin + 3.2.0 + + + attach-sources + + jar + + + + + + + + diff --git a/spring-cloud-tencent-examples/polaris-router-example/router-caller-service/src/main/java/com/tencent/cloud/polaris/router/example/RouterCalleeService.java b/spring-cloud-tencent-examples/polaris-router-example/router-caller-service/src/main/java/com/tencent/cloud/polaris/router/example/RouterCalleeService.java new file mode 100644 index 000000000..52439e3e5 --- /dev/null +++ b/spring-cloud-tencent-examples/polaris-router-example/router-caller-service/src/main/java/com/tencent/cloud/polaris/router/example/RouterCalleeService.java @@ -0,0 +1,35 @@ +/* + * Tencent is pleased to support the open source community by making Spring Cloud Tencent available. + * + * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. + * + * Licensed under the BSD 3-Clause License (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://opensource.org/licenses/BSD-3-Clause + * + * Unless required by applicable law or agreed to in writing, software distributed + * under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR + * CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + * + */ + +package com.tencent.cloud.polaris.router.example; + +import org.springframework.cloud.openfeign.FeignClient; +import org.springframework.web.bind.annotation.GetMapping; + +/** + * Router callee feign client. + * + * @author lepdou 2022-04-06 + */ +@FeignClient("RouterCalleeService") +public interface RouterCalleeService { + + @GetMapping("/router/service/callee/info") + String info(); + +} diff --git a/spring-cloud-tencent-examples/polaris-router-example/router-caller-service/src/main/java/com/tencent/cloud/polaris/router/example/RouterCallerApplication.java b/spring-cloud-tencent-examples/polaris-router-example/router-caller-service/src/main/java/com/tencent/cloud/polaris/router/example/RouterCallerApplication.java new file mode 100644 index 000000000..f7b114a41 --- /dev/null +++ b/spring-cloud-tencent-examples/polaris-router-example/router-caller-service/src/main/java/com/tencent/cloud/polaris/router/example/RouterCallerApplication.java @@ -0,0 +1,48 @@ +/* + * Tencent is pleased to support the open source community by making Spring Cloud Tencent available. + * + * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. + * + * Licensed under the BSD 3-Clause License (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://opensource.org/licenses/BSD-3-Clause + * + * Unless required by applicable law or agreed to in writing, software distributed + * under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR + * CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + * + */ + +package com.tencent.cloud.polaris.router.example; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.cloud.client.discovery.EnableDiscoveryClient; +import org.springframework.cloud.client.loadbalancer.LoadBalanced; +import org.springframework.cloud.openfeign.EnableFeignClients; +import org.springframework.context.annotation.Bean; +import org.springframework.web.client.RestTemplate; + +/** + * Router caller application. + * + *@author lepdou 2022-04-06 + */ +@SpringBootApplication +@EnableDiscoveryClient +@EnableFeignClients +public class RouterCallerApplication { + + public static void main(String[] args) { + SpringApplication.run(RouterCallerApplication.class, args); + } + + @Bean + @LoadBalanced + public RestTemplate restTemplate() { + return new RestTemplate(); + } +} diff --git a/spring-cloud-tencent-examples/polaris-router-example/router-caller-service/src/main/java/com/tencent/cloud/polaris/router/example/RouterCallerController.java b/spring-cloud-tencent-examples/polaris-router-example/router-caller-service/src/main/java/com/tencent/cloud/polaris/router/example/RouterCallerController.java new file mode 100644 index 000000000..13b4ed4b7 --- /dev/null +++ b/spring-cloud-tencent-examples/polaris-router-example/router-caller-service/src/main/java/com/tencent/cloud/polaris/router/example/RouterCallerController.java @@ -0,0 +1,71 @@ +/* + * Tencent is pleased to support the open source community by making Spring Cloud Tencent available. + * + * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. + * + * Licensed under the BSD 3-Clause License (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://opensource.org/licenses/BSD-3-Clause + * + * Unless required by applicable law or agreed to in writing, software distributed + * under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR + * CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + * + */ + +package com.tencent.cloud.polaris.router.example; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.client.RestTemplate; + +/** + * Discovery caller controller. + * + * @author lepdou 2022-04-06 + */ +@RestController +@RequestMapping("/router/service/caller") +public class RouterCallerController { + + @Autowired + private RestTemplate restTemplate; + + @Autowired + private RouterCalleeService routerCalleeService; + + /** + * Get info of two value. + * @return info + */ + @GetMapping("/feign") + public String feign() { + return routerCalleeService.info(); + } + + /** + * Get information of callee. + * @return information of callee + */ + @GetMapping("/rest") + public String rest() { + return restTemplate.getForObject( + "http://DiscoveryCalleeService/discovery/service/callee/info", + String.class); + } + + /** + * health check. + * @return health check info + */ + @GetMapping("/healthCheck") + public String healthCheck() { + return "pk ok"; + } + +} diff --git a/spring-cloud-tencent-examples/polaris-router-example/router-caller-service/src/main/resources/bootstrap.yml b/spring-cloud-tencent-examples/polaris-router-example/router-caller-service/src/main/resources/bootstrap.yml new file mode 100644 index 000000000..a7619a4ff --- /dev/null +++ b/spring-cloud-tencent-examples/polaris-router-example/router-caller-service/src/main/resources/bootstrap.yml @@ -0,0 +1,11 @@ +server: + port: 48083 +spring: + application: + name: RouterCallerService + cloud: + loadbalancer: + configurations: polaris + polaris: + address: grpc://127.0.0.1:8091 + namespace: default diff --git a/spring-cloud-tencent-examples/pom.xml b/spring-cloud-tencent-examples/pom.xml index 61106d501..2e86e4d8d 100644 --- a/spring-cloud-tencent-examples/pom.xml +++ b/spring-cloud-tencent-examples/pom.xml @@ -21,6 +21,7 @@ polaris-circuitbreaker-example polaris-gateway-example polaris-config-example + polaris-router-example