quickstart-example-provider/src/main/resources/polaris.yml and quickstart-example-consumer/src/main/resources/polaris.yml files respectively.quickstart-example-provider/src/main/resources/polaris.yml as an example).export ZONE=$(curl http://metadata.tencentyun.com/latest/meta-data/placement/region)export CAMPUS=$(curl http://metadata.tencentyun.com/latest/meta-data/placement/zone)
global:serverConnector:addresses:# Set the Polaris server access address- 10.0.4.6:8091# Set parameters related to service invocationconsumer:serviceRouter:plugin:# Set the nearby routing plugin configurationnearbyBasedRouter:# Description: The minimum matching level for nearby routing must be explicitly set# Scope: zone (Tencent Cloud region information, eg: ap-guangzhou), campus (Tencent Cloud AZ, eg: ap-guangzhou-3)matchLevel: campus
global:serverConnector:addresses:# Set the Polaris server access address- 10.0.4.6:8091# Set the way for the SDK to obtain its own geographic location informationlocation:providers:# Set the SDK to obtain region information by invoking an http interface- type: remoteHttpoptions:zone: http://metadata.tencentyun.com/latest/meta-data/placement/regioncampus: http://metadata.tencentyun.com/latest/meta-data/placement/zone# Set parameters related to service invocationconsumer:serviceRouter:plugin:# Set the nearby routing plugin configurationnearbyBasedRouter:# Description: The minimum matching level for nearby routing must be explicitly set# Scope: zone (Tencent Cloud region information, eg: ap-guangzhou), campus (Tencent Cloud AZ, eg: ap-guangzhou-3)matchLevel: campus


${app.port} with the listening port of the consumer (default: 16011), and ${add.address} with the exposed IP address of the consumer.curl -L -X GET 'http://${add.address}:${app.port}/echo?value=hello_world'# Expected to return service provider instance information in the same Tencent Cloud AZ as the consumerExpected return value: "echo: hello_world, from: ${target instance port}, location: ${instance geographical location information}";
피드백