1.3.8. 添加 XML 路由
默认情况下,您可以将 Camel XML 路由放在目录 camel 下的类路径中,该路径 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>