benko233 commented on issue #14430:
URL: https://github.com/apache/dubbo/issues/14430#issuecomment-2416160629

   If provide version, the invoker in pathResolver must have non-equal 
serviceKey and interfaceName. At this scenario, all overridings fail.
   I think more reasonable to compare `url.getServiceKey()` with 
`previous.getUrl().getServiceKey()` at `TripleProtocol#export`.
   ```
   @Override
       public <T> Exporter<T> export(Invoker<T> invoker) throws RpcException {
        // ...
        Invoker<?> previous = pathResolver.add(url.getServiceKey(), invoker);
           if (previous != null) {
               if 
(url.getServiceKey().equals(previous.getUrl().getServiceKey())) {
                   logger.info("Already exists an invoker[" + previous.getUrl() 
+ "] on path[" + url.getServiceKey()
                       + "], dubbo will override with invoker[" + url + "]");
               } else {
                   throw new IllegalStateException("Already exists an invoker[" 
+ previous.getUrl() + "] on path[" +
                       url.getServiceKey() + "], failed to add invoker[" + url +
                       "] , please use unique serviceKey.");
               }
           }
        // ...
       }
   ```


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