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


##########
protocol/grpc/server.go:
##########
@@ -139,12 +121,7 @@ func (s *Server) Start(url *common.URL) {
                                logger.Infof("gRPC Server initialized the 
TLSConfig configuration")
                                serverOpts = append(serverOpts, 
grpc.Creds(credentials.NewTLS(cfg)))
                        }
-               } else {
-                       serverOpts = append(serverOpts, 
grpc.Creds(insecure.NewCredentials()))
                }
-       } else {
-               // TODO: remove this else
-               serverOpts = append(serverOpts, 
grpc.Creds(insecure.NewCredentials()))
        }

Review Comment:
   这里不应该是有TLSConfigKey的时候append 
credentials.NewTLS(cfg),没有的时候grpc.Creds(insecure.NewCredentials())吗
   现在的逻辑是有没有都grpc.Creds(insecure.NewCredentials())



##########
protocol/dubbo3/dubbo3_protocol.go:
##########
@@ -80,17 +77,16 @@ func NewDubboProtocol() *DubboProtocol {
 func (dp *DubboProtocol) Export(invoker base.Invoker) base.Exporter {
        url := invoker.GetURL()
        serviceKey := url.ServiceKey()
-       exporter := NewDubboExporter(serviceKey, invoker, dp.ExporterMap(), 
dp.serviceMap)
-       dp.SetExporterMap(serviceKey, exporter)
-       logger.Infof("[Triple Protocol] Export service: %s", url.String())
 
        key := url.GetParam(constant.BeanNameKey, "")
        var service any
-       //TODO: Temporary compatibility with old APIs, can be removed later
-       service = config.GetProviderService(key)
        if rpcService, ok := url.GetAttribute(constant.RpcServiceKey); ok {
                service = rpcService
        }
+       if service == nil {
+               logger.Errorf("no rpc service found in url attribute %s for 
service key: %s", constant.RpcServiceKey, key)

Review Comment:
   ```suggestion
                logger.Errorf("[Triple Protocol] No rpc service found in url 
attribute %s for service key: %s", constant.RpcServiceKey, key)
   ```



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

Review Comment:
   需不需要置为nil呀



##########
protocol/grpc/client.go:
##########
@@ -127,12 +108,7 @@ func NewClient(url *common.URL) (*Client, error) {
                                logger.Infof("Grpc Client initialized the 
TLSConfig configuration")
                                dialOpts = append(dialOpts, 
grpc.WithTransportCredentials(credentials.NewTLS(cfg)))
                        }
-               } else {
-                       dialOpts = append(dialOpts, 
grpc.WithTransportCredentials(insecure.NewCredentials()))
                }
-       } else {
-               // TODO: remove this else
-               dialOpts = append(dialOpts, 
grpc.WithTransportCredentials(insecure.NewCredentials()))
        }

Review Comment:
   ditto



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