404008945 commented on issue #10393: URL: https://github.com/apache/dubbo/issues/10393#issuecomment-1272430663
> org.apache.dubbo.registry.nacos.NacosAggregateListener 内部会聚合 NacosAggregateListener 内部会聚合这个我明白,我的意思是两种url共用了同一个nacosListener(因为computeIfAbsent),都会触发同一个nacosListener,而这个nacosListener中的serviceName又是固定的(先进入方法的那个serviceName)。 现在假设 同一服务的两种serviceName,A1(有实例)和A2(空实例) 1. A1首先进入subscribeEventListener方法,那么会注册添加一个nacos监听器EventListener,使用匿名内部类的形式创建,内部类中的serviceName就是A1,然后使用这个nacosListener监听A1 2. A2之后再进入subscribeEventListener ,A2会和A1共用同一个nacosListener,那么这个nacosListener的serviceName仍然是A1 同样使用这个nacosListener监听A2 那么当 nacos通知A2无实例时,调用nacosListener,监听器中调用notifySubscriber(url, serviceName, listener, instances); 但是这个serviceNames是A1,**变成了通知A1无实例**  -- 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]
