mark4z opened a new issue, #2581:
URL: https://github.com/apache/dubbo-go/issues/2581

   ### Environment
   
   <!-- 
   - Server: Dubbo-go, v3.0.5
   - Client: Dubbo-go, v3.0.5
   - Protocol: Triple
   - Registry: Nacos, v2.0.0
   -->
   
   - Server: Dubbo-go v3.1.1-rc1
   - Client: 
   - Protocol: tri/dubbo
   - Registry: Nacos
   
   ### Issue description
   
   <!-- Here is a brief description about the issue. -->
   nacos-go-sdkv2.0 changed the semantics of namingclient.RegisterInstance, 
resulting in each RegisterInstance() overwriting the entire nacos service 
instead of appending an Instance.
   
   I think this is an unreasonably breaking change of nacos-go-sdk, and perhaps 
nacos-go-sdk rather than dubbogo should be the one to fix it.
   
   ```yaml
     protocols:
       dubbo:
         name: dubbo
         port: 20000
       tri:
         name: tri
         port: 20001
   ```
   
   ```go
   // Register will register the service @url to its nacos registry center.
   func (nr *nacosRegistry) Register(url *common.URL) error {
        start := time.Now()
        serviceName := getServiceName(url)
        groupName := nr.URL.GetParam(constant.NacosGroupKey, defaultGroup)
        param := createRegisterParam(url, serviceName, groupName)
        logger.Infof("[Nacos Registry] Registry instance with param = %+v", 
param)
        isRegistry, err := nr.namingClient.Client().RegisterInstance(param)
        metrics.Publish(metricsRegistry.NewRegisterEvent(err == nil && 
isRegistry, start))
        if err != nil {
                return err
        }
        if !isRegistry {
                return perrors.New("registry [" + serviceName + "] to  nacos 
failed")
        }
        nr.registryUrls = append(nr.registryUrls, url)
        return nil
   }
   ```
   
![image](https://github.com/apache/dubbo-go/assets/36187602/33e866b2-d2a6-4e3d-b33b-f79d2fe0e6d3)
   
   ### Logs
   
   <details><summary>Click me to check logs</summary>
   
   ```
   Copy logs to here.
   ```
   
   </details>
   


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

Reply via email to