6.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 ファイルは、CamelContext ではなく、次のような Camel XML rest である必要があります。
<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>