6.15. 为自动配置添加 XML Rest-DSL 路由
Camel Spring Boot 组件会自动探测并嵌入 camel-rest
目录下的 classpath 中添加的 Camel Rest-DSL XML 路由。您可以使用配置选项配置目录名称或禁用此功能。
流程
在 classpath 中配置 Camel Spring Boot Rest-DSL XML 路由,如下所示:
// turn off camel.springboot.xmlRests = false // scan in the com/foo/routes classpath camel.springboot.xmlRests = classpath:com/foo/rests/*.xml
// turn off camel.springboot.xmlRests = false // scan in the com/foo/routes classpath camel.springboot.xmlRests = classpath:com/foo/rests/*.xml
Copy to Clipboard Copied! Toggle word wrap Toggle overflow 注意Rest-DSL XML 文件应该定义 Camel XML REST 元素,而不是
CamelContext
元素,例如:Copy to Clipboard Copied! Toggle word wrap Toggle overflow