nanjiek commented on code in PR #3231:
URL: https://github.com/apache/dubbo-go/pull/3231#discussion_r2899840318


##########
protocol/grpc/client.go:
##########
@@ -142,25 +118,25 @@ func NewClient(url *common.URL) (*Client, error) {
        }
 
        key := url.GetParam(constant.InterfaceKey, "")
-       //TODO: Temporary compatibility with old APIs, can be removed later
-       consumerService := config.GetConsumerServiceByInterfaceName(key)
-       if consumerService == nil {
-               if rpcService, ok := url.GetAttribute(constant.RpcServiceKey); 
ok {
-                       consumerService = rpcService
-               }
+       var consumerService any
+       if rpcService, ok := url.GetAttribute(constant.RpcServiceKey); ok {
+               consumerService = rpcService
        }
        invoker := getInvoker(consumerService, conn)
+       invokerValue := reflect.Value{}
+       if invoker != nil {
+               invokerValue = reflect.ValueOf(invoker)
+       } else {
+               logger.Warnf("grpc client invoker is nil, interface=%s", key)

Review Comment:
   ```suggestion
                logger.Errorf("[gRPC Client] Initialize failed: invoker is nil 
for service %s", url.ServiceKey())
           return nil, fmt.Errorf("grpc invoker is nil")
   ```



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