spring - 春季启动时未加载 XML 中的 Apache 骆驼路由
问题描述
我们将 Apache Camel 版本从 3.2 迁移到 3.9.0。之后,不会加载 XML 中配置的路由。
我已将应用程序 YAML 中的属性从 xmlRoutes 更改为 apache.springboot.routes-include-pattern=classpath:camel/routes/*.xml。但是行为很奇怪,在本地,当我使用 intellij 运行时,会加载 XML 中配置的所有路由。但是一旦部署了更改,只会加载由 bean 配置的路由。
记录器说:
没有从以下位置发现其他 RoutesBuilder:classpath:camel/routes/*.xml
您能否就可能存在的问题提供意见。
如果无法解决此问题,是否有任何其他方式可以从 XML 配置路由。
解决方案
从 2.x 迁移到 3.x 时,我遇到了类似的问题。我的 XML 路由文件夹似乎没有被扫描。我发现我需要根据https://camel.apache.org/manual/camel-3x将设置从“camel.springboot.xml-routes”迁移到“camel.springboot.routes-include-pattern” -upgrade-guide-3_8.html#_configuration_changes。在您的情况下,设置应为:
camel.springboot.routes-include-pattern=class-path:camel/routes/*.xml
推荐阅读
- sql - 尽管我在其他查询中使用它,但在 tables_list 中看不到表
- c# - 读取当月 SQL 的日期
- python - 如何更改 Anaconda 和 Windows 7 的 PYTHONPATH?
- azure - azure api管理soap休息功能
- java - 如果用户已经通过 Google 使用 Firebase 进行了身份验证,当我尝试启动新活动时,应用程序会崩溃。
- c# - C#:将文本框绑定到对象属性
- sql - 根据Redshift sql中另一列的条件从列中删除字符
- javascript - PHP代码不能与“onclick”上的JS函数一起使用
- mysql - 未付月薪(mysql +vb.net)
- loops - Cmd 命令删除一个目录的所有子文件夹,并用相同的名称重新制作它们