nagisa-kunhah commented on code in PR #3372:
URL: https://github.com/apache/dubbo-go/pull/3372#discussion_r3369203457


##########
registry/protocol/protocol.go:
##########
@@ -296,49 +381,41 @@ func registerServiceMap(invoker base.Invoker) error {
        // such as 
dubbo://:20000/org.apache.dubbo.UserProvider?bean.name=UserProvider&cluster=failfast...
        id := providerUrl.GetParam(constant.BeanNameKey, "")
 
-       // TODO: Temporary compatibility with old APIs, can be removed later
-
-       providerConfig := config.GetProviderConfig()
+       providerConfRaw, ok := 
providerUrl.GetAttribute(constant.ProviderConfigKey)
+       if !ok {
+               return perrors.Errorf("reExport can not get provider config 
from url attribute %s", constant.ProviderConfigKey)
+       }
+       providerConf, ok := providerConfRaw.(*global.ProviderConfig)
+       if !ok || providerConf == nil {
+               return perrors.Errorf("reExport got illegal provider config 
from url attribute %s", constant.ProviderConfigKey)
+       }

Review Comment:
   Thanks , I fixed the legacy ServiceConfig.Export() path by attaching the 
required attributes to the provider URL:
   ```go
   common.WithAttribute(constant.RpcServiceKey, s.rpcService),
   common.WithAttribute(constant.ProviderConfigKey, s.rc.Provider),
   ```
   `reExport` later calls `registerServiceMap(invoker)`, and 
`registerServiceMap()` reads `ProviderConfigKey` and `RpcServiceKey` from the 
provider URL in the original invoker. 



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