SuperEdison edited a comment on issue #9661:
URL: https://github.com/apache/dubbo/issues/9661#issuecomment-1038599118


   你可以去看看Nacos通知消费者可用的那一段代码。
   
![image](https://user-images.githubusercontent.com/84554944/153795655-4f51c22e-1882-47c4-902f-53ad43175d88.png)
   
![image](https://user-images.githubusercontent.com/84554944/153795794-1c00bac8-a491-4bcd-8a3f-470156693f9d.png)
   
![image](https://user-images.githubusercontent.com/84554944/153795841-cec18c10-8dc4-4fa0-9ecd-a80b8885d7ba.png)
   
当项目启动的时候ExchangeClient会为空,而当注册中心通知dubbo后会去创建ExchangClient并且创建代理。实际是真的没有可用生产者,如果你是双节点的话说明nacos还没通知到第一个重启的节点,你就已经重启第二个节点了,如果你是节点高可用持续发布的状态下,你可以等一个消费者启动完等待1分钟左右再去shutdown另一个节点,这样就可以有足够时间等待nacos通知,并且创建代理。nacos通知的时机并不是实时的,不是说你消费者一启动好就马上可以创建代理。而是看nacos目前的压力大小(这个仅仅我自己测过具体源码没看)。


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