“Vanilla” Apache Camel 具有RouteController,可以选择监督路由,这样就可以捕获失败的路由,而不是让整个 Camel 瘫痪(这是默认行为)。在 Camel Quarkus 中,我不确定如何处理路由启动失败,因为一切都有点高级。我像疯子一样在谷歌上搜索,但遗憾的是无济于事。有什么关于如何解决这个问题的提示吗?
更具体地说:在初始化 Camel Quarkus 集成微服务时,我有多个 WebSocket 连接可能处于活动状态或可能不处于活动状态,但我希望后者继续尝试直到它们再次启动,而不是导致整个应用程序崩溃。
路由控制器和“监督”路由可用于 Camel Quarkus。您可以
camel.routecontroller
在 中配置属性application.properties
。这里有一个示例项目演示了这一点:https://github.com/apache/camel-quarkus-examples/tree/main/health
应用程序配置的相关部分在这里:
https://github.com/apache/camel-quarkus-examples/blob/main/health/src/main/resources/application.properties#L30-L40