1.2.10. 添加 XML 路由
默认情况下,您可以将 Camel XML 路由放在类路径下,它位于 camel-spring-boot 目录下,其中包括:您可以使用配置选项配置目录名称或关闭此名称:
# turn off
camel.springboot.routes-include-pattern = false
# scan only in the com/foo/routes classpath
camel.springboot.routes-include-pattern = classpath:com/foo/routes/*.xml
XML 文件应为 Camel XML 路由(而不是 < CamelContext>),例如:
<routes xmlns="http://camel.apache.org/schema/spring">
<route id="test">
<from uri="timer://trigger"/>
<transform>
<simple>ref:myBean</simple>
</transform>
<to uri="log:out"/>
</route>
</routes>