November22 commented on code in PR #11498: URL: https://github.com/apache/dubbo/pull/11498#discussion_r1119892320
########## dubbo-registry/dubbo-registry-nacos/src/main/java/org/apache/dubbo/registry/nacos/NacosRegistry.java: ########## @@ -638,6 +639,12 @@ private URL buildURL(URL consumerURL, Instance instance) { return new DubboServiceAddressURL(url.getUrlAddress(), url.getUrlParam(), consumerURL, null); } + + private void setWeight(Map<String, String> metadata, double nacosWeight) { + long weight = Math.round(org.apache.dubbo.rpc.cluster.Constants.DEFAULT_WEIGHT * nacosWeight); Review Comment: For example, for interface A, I start three instances and set three different weights respectively. The set weights are stored in the org.apache.dubbo.common.URL parameter. When reporting, the weight is obtained from the URL parameter, and the delivered weight Get it from com.alibaba.nacos.api.naming.pojo.Instance#weight; ———————— 比如A接口,我启动三个实例,分别设置三个不同的权重,设置的权重存储在org.apache.dubbo.common.URL 参数中,上报的时候从URL参数中获取到权重,下发的权重的时候从com.alibaba.nacos.api.naming.pojo.Instance#weight 获取; -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: notifications-unsubscr...@dubbo.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: notifications-unsubscr...@dubbo.apache.org For additional commands, e-mail: notifications-h...@dubbo.apache.org