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


##########
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:
   > > > The changes are as shown in the figure (default rounding for double) 
![image](https://user-images.githubusercontent.com/26109828/219524146-b4897fff-bd35-45b2-8ff4-f8fe90c7cce1.png)
   > > 
   > > 
   > > This is an good idea. But I am afraid that it would not work in 
ServiceDiscovery model.
   > 
   > I verified it, it works. When registering, set the weight of dubbo to 
Nacos; the weight issued by Nacos can be set to Dubbo;
   > 
   > 
![image](https://user-images.githubusercontent.com/26109828/220078320-7fcac8e3-6db8-4e1f-b51c-393501ffa34a.png)
   
   If different service has different weight, it may conflict.



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