November22 commented on code in PR #11498:
URL: https://github.com/apache/dubbo/pull/11498#discussion_r1099564403


##########
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:
   > `Math.round(org.apache.dubbo.rpc.cluster.Constants.DEFAULT_WEIGHT * 
nacosWeight)` will override the weight from Dubbo provider
   
   
   Yes, I may be able to modify it to judge whether Nacos is the default weight 
1, if it is, the weight of Dubbo will not be updated, if not, the weight of 
Dubbo will be updated;
   It’s just that the default weight 1 of Nacos is maintained in 
`com.alibaba.nacos.api.naming.pojo.Instance#weight`, which is not a constant, 
so a new constant value needs to be added to maintain the default value of 
Nacos weight;(what do you think of this way)
   
   



-- 
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

Reply via email to