
quickstart-example-provider/src/main/resources/polaris.yml以及quickstart-example-consumer/src/main/resources/polaris.yml文件。quickstart-example-provider/src/main/resources/polaris.yml为例)。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:# 设置北极星服务端接入地址- 10.0.4.6:8091# 设置服务调用相关参数consumer:serviceRouter:plugin:# 设置就近路由插件配置nearbyBasedRouter:# 描述:就近路由的最小匹配级别,需要显示设置# 范围: zone(腾讯云地域信息,eg: ap-guangzhou)、campus(腾讯云可用区, eg: ap-guangzhou-3)matchLevel: campus
global:serverConnector:addresses:# 设置北极星服务端接入地址- 10.0.4.6:8091# 设置 SDK 获取自身地理位置信息的方式location:providers:# 设置 SDK 通过调用 http 接口获取地域信息数据- type: remoteHttpoptions:zone: http://metadata.tencentyun.com/latest/meta-data/placement/regioncampus: http://metadata.tencentyun.com/latest/meta-data/placement/zone# 设置服务调用相关参数consumer:serviceRouter:plugin:# 设置就近路由插件配置nearbyBasedRouter:# 描述:就近路由的最小匹配级别,需要显示设置# 范围: zone(腾讯云地域信息,eg: ap-guangzhou)、campus(腾讯云可用区, eg: ap-guangzhou-3)matchLevel: campus


${app.port}替换为 consumer 的监听端口(默认为16011),${add.address}则替换为 consumer 暴露的地址。curl -L -X GET 'http://${add.address}:${app.port}/echo?value=hello_world'# 预期返回与 consumer 同腾讯云可用区的服务提供者实例信息预期返回值:"echo: hello_world, from: ${目标实例端口}, location: ${实例地理位置信息}";
文档反馈