1kasa commented on code in PR #2882:
URL: https://github.com/apache/dubbo-go/pull/2882#discussion_r2095610276


##########
registry/servicediscovery/service_discovery_registry.go:
##########
@@ -101,23 +102,29 @@ func (s *serviceDiscoveryRegistry) RegisterService() 
error {
                                return err
                        }
                }
-               return s.serviceDiscovery.Register(s.instance)
+               err := s.serviceDiscovery.Register(instance)
+               if err != nil {
+                       return perrors.WithMessage(err, "Register service 
failed")
+               }
        }
        return nil
 }
 
-func createInstance(meta *info.MetadataInfo) registry.ServiceInstance {
-       params := make(map[string]string, 8)
-       params[constant.MetadataStorageTypePropertyName] = 
metadata.GetMetadataType()
+func createInstance(meta *info.MetadataInfo, url *common.URL) 
registry.ServiceInstance {
+       port, err := strconv.Atoi(url.Port)
+       if err != nil {
+               logger.Warnf("Parse port %s failed, err: %v", url.Port, err)
+       }
        instance := &registry.DefaultServiceInstance{
+               ID:              url.Address(),
+               Host:            url.Ip,
+               Port:            port,
                ServiceName:     meta.App,
                Enable:          true,
                Healthy:         true,
-               Metadata:        params,

Review Comment:
   Can you explain why you deleted it?



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