We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Java-Chassis做微服务调用的时候, 要求能从 MicroserviceMeta 中取出 ServicePathManager 实例. 而将 ServicePathManager 设置进 MicroserviceMeta 的逻辑是在 RestEngineSchemaListener#onCreateMicroserviceVersion 方法中执行的. 这个监听器从 guava EventBus 监听 CreateMicroserviceVersionEvent 事件, 并创建 ServicePathManager 与对应的 MicroserviceVersion 关联起来.
MicroserviceMeta
ServicePathManager
RestEngineSchemaListener#onCreateMicroserviceVersion
EventBus
CreateMicroserviceVersionEvent
MicroserviceVersion
RestEngineSchemaListener 是在BEFORE_REGISTRY事件阶段注册到 EventBus 的, 也就是说, 如果有MicroserviceVersion对象是在RestEngineSchemaListener注册到 EventBus 之前创建的, 则它无法触发 RestEngineSchemaListener 执行上述动作, 也就不会有对应的 ServicePathManager 对象. 而且, 这个问题是不可恢复的, 一旦MicroserviceVersion对象有这个问题, 除非重启, 否则它一直会保持有问题的状态, 导致consumer端一直调用不了对应的producer微服务.
RestEngineSchemaListener
BEFORE_REGISTRY
例如, EdgeService场景下, EdgeInvocation#edgeInvoke 就会触发创建MicroserviceVersion对象, 这是有可能在 BEFORE_REGISTRY 事件之前触发的(它不在SCBEngine#ensureStatusUp的保护范围之内).
EdgeInvocation#edgeInvoke
SCBEngine#ensureStatusUp
这两条都有价值做, 因为建议2无法完全拦截建议1涉及的场景.
The text was updated successfully, but these errors were encountered:
可以提交PR尝试下吗?
Sorry, something went wrong.
No branches or pull requests
问题原理分析
Java-Chassis做微服务调用的时候, 要求能从
MicroserviceMeta
中取出ServicePathManager
实例. 而将ServicePathManager
设置进MicroserviceMeta
的逻辑是在RestEngineSchemaListener#onCreateMicroserviceVersion
方法中执行的. 这个监听器从 guavaEventBus
监听CreateMicroserviceVersionEvent
事件, 并创建ServicePathManager
与对应的MicroserviceVersion
关联起来.RestEngineSchemaListener
是在BEFORE_REGISTRY
事件阶段注册到EventBus
的, 也就是说, 如果有MicroserviceVersion
对象是在RestEngineSchemaListener
注册到EventBus
之前创建的, 则它无法触发RestEngineSchemaListener
执行上述动作, 也就不会有对应的ServicePathManager
对象. 而且, 这个问题是不可恢复的, 一旦MicroserviceVersion
对象有这个问题, 除非重启, 否则它一直会保持有问题的状态, 导致consumer端一直调用不了对应的producer微服务.例如, EdgeService场景下,
EdgeInvocation#edgeInvoke
就会触发创建MicroserviceVersion
对象, 这是有可能在BEFORE_REGISTRY
事件之前触发的(它不在SCBEngine#ensureStatusUp
的保护范围之内).建议
RestEngineSchemaListener
, 目前它做的事情就是在MicroserviceVersion
对象创建出来的时候, 创建一个ServicePathManager
对象与之对应. 这个流程能否挪到MicroserviceVersion
自身的初始化方法中?SCBEngine#ensureStatusUp
状态检查.这两条都有价值做, 因为建议2无法完全拦截建议1涉及的场景.
The text was updated successfully, but these errors were encountered: