AlbumenJ commented on code in PR #11498:
URL: https://github.com/apache/dubbo/pull/11498#discussion_r1105217469
##########
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:
It would be better to intoduce a new param like `registry_weight`. Set it in
NacosRegistry and NacosServiceDiscoveryRegistry and get it in
`org.apache.dubbo.rpc.cluster.loadbalance.AbstractLoadBalance#getWeight`.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]