zhaoyunxing92 commented on code in PR #2000:
URL: https://github.com/apache/dubbo-go/pull/2000#discussion_r934112012


##########
cluster/router/chain/chain.go:
##########
@@ -52,7 +53,22 @@ type RouterChain struct {
 
 // Route Loop routers in RouterChain and call Route method to determine the 
target invokers list.
 func (c *RouterChain) Route(url *common.URL, invocation protocol.Invocation) 
[]protocol.Invoker {
-       finalInvokers := c.invokers
+       finalInvokers := make([]protocol.Invoker, 0, len(c.invokers))
+       // multiple invoker may include different methods, find correct invoker 
otherwise
+       // will return the invoker without methods
+       for _, invoker := range c.invokers {
+               invokerURL := invoker.GetURL()
+               if invokerURL.Version() == url.Version() &&

Review Comment:
   
这个地方看看是不是使用[url.ServiceKey()](https://github.com/apache/dubbo-go/blob/master/common/url.go#L371-L374)会好点



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