4.13. 添加 XML Rest-DSL
默认情况下,您可以将 Camel Rest-DSL XML 路由放在 camel-rest 目录下的类路径中,camel-spring-boot 将自动检测并包含。您可以使用配置选项配置目录名称或禁用此功能,如下所示:
// turn off
camel.springboot.xmlRests = false
// scan in the com/foo/routes classpath
camel.springboot.xmlRests = classpath:com/foo/rests/*.xml
注意
Rest-DSL XML 文件应该是 Camel XML rests,而不是 CamelContext,例如:
<rests xmlns="http://camel.apache.org/schema/spring">
<rest>
<post uri="/persons">
<to uri="direct:postPersons"/>
</post>
<get uri="/persons">
<to uri="direct:getPersons"/>
</get>
<get uri="/persons/{personId}">
<to uri="direct:getPersionId"/>
</get>
<put uri="/persons/{personId}">
<to uri="direct:putPersionId"/>
</put>
<delete uri="/persons/{personId}">
<to uri="direct:deletePersionId"/>
</delete>
</rest>
</rests>