Camel Spring Boot扫描RouteBuilders的Spring上下文 . F rom the documentation:
Camel自动配置从Spring上下文中收集所有RouteBuilder实例,并自动将它们注入到提供的CamelContext中 . 这意味着使用Spring Boot启动程序创建新的Camel路径就像将@Component注释类添加到类路径一样简单
有没有办法控制这个:包括/排除包或类 .
我想注释某些RouteBuilders并让Camel排除那些 . 我的目的是稍后将它们动态添加到CamelContext中 .
1 回答
您可以使用设置为SpringBootTest Annotation的这些属性 .
java-routes-inlcude-pattern - 包含测试中路由的模式
java-routes-exclude-pattern - 用于排除测试中路由的模式
这些是ant样式属性,可搜索src文件夹以匹配RouteBuilders
Example with pattern:
Example for fix class:
java-routes-exclude-pattern以相同的方式工作,只是排除列出的路由构建器 .
希望这可以帮助 .
电贺
克里斯