Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

哪位大佬知道服务注册用的为什么是postProcessBeforeInitialization,而不是postProcessAfterInitialization吗? #40

Open
zhongyingxiang opened this issue Apr 6, 2021 · 3 comments

Comments

@zhongyingxiang
Copy link

哪位大佬知道服务注册到zookeeper用的为什么是postProcessBeforeInitialization,而不是postProcessAfterInitialization吗?
image

@deepbreath373
Copy link

RpcReference是在After中来完成服务的调用,RpcReference是在Before中完成服务的注册。
就是为了让RpcService在被调用之前完成服务注册(就是在Before中实现),避免RpcReference在服务还没注册之前就调用了服务。
不知道对不对。:-)

@MrZhang-badminton
Copy link
Contributor

+1,我也这么理解的

@zhongyingxiang
Copy link
Author

zhongyingxiang commented Mar 5, 2022

个人觉得应该要在服务启动之后才注册到zookeeper,不能提前暴露,不管放在postProcessBeforeInitialization还是postProcessAfterInitialization,都是不合适的。当然这个只是一个demo,不用考虑这个。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants