您可以收听SpringCamelContext状态吗?
使用EventNotifierSupport,我可以听CamelContextStartedEvent。但是,在所有其他路线已经初始化之后,我需要在上下文中添加一个根。目前,该事件发生在初始化CamelContext之后发生,但是在此之后,我们添加了数百条SpringCamelContext路线,据我了解,没有“ SpringCamelContextStarteDedevent”,所以我不知道如何在所有其他路线已经添加所有其他路线之后,初始化。我怀疑我的逻辑存在根本错误,如果我在某个地方错了,请纠正我。
@Override
public void notify(EventObject event) throws Exception {
if (event instanceof CamelContextStartedEvent) {
log.info("CamelContextStartedEvent for {}", event.getSource());
startWarmupThread();
}
}
Using EventNotifierSupport, I can listen for CamelContextStartedEvent. However, I need to add one more root to the context, after all the other routes have already been initialized. Currently, the event occurs after camelcontext have been initialized, but after that we have hundreds of SpringCamelContext routes added, and as I understand, there is no "SpringCamelContextStartedEvent", so I have no idea of how to add route after all other routes are already initialized. I suspect that there is fundamental error in my logic, please correct me if I am wrong somewhere.
@Override
public void notify(EventObject event) throws Exception {
if (event instanceof CamelContextStartedEvent) {
log.info("CamelContextStartedEvent for {}", event.getSource());
startWarmupThread();
}
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论