175.2. JiBX Spring DSL
JiBX データ形式は、Camel Spring DSL でもサポートされています。
<camelContext id="camel" xmlns="http://camel.apache.org/schema/spring"> <!-- Define data formats --> <dataFormats> <jibx id="jibx" unmarshallClass="org.apache.camel.dataformat.jibx.PurchaseOrder"/> </dataFormats> <!-- Marshal message to XML --> <route> <from uri="direct:marshal"/> <marshal ref="jibx"/> <to uri="mock:result"/> </route> <!-- Unmarshal message from XML --> <route> <from uri="direct:unmarshal"/> <unmarshal ref="jibx"/> <to uri="mock:result"/> </route> </camelContext>
<camelContext id="camel" xmlns="http://camel.apache.org/schema/spring">
<!-- Define data formats -->
<dataFormats>
<jibx id="jibx" unmarshallClass="org.apache.camel.dataformat.jibx.PurchaseOrder"/>
</dataFormats>
<!-- Marshal message to XML -->
<route>
<from uri="direct:marshal"/>
<marshal ref="jibx"/>
<to uri="mock:result"/>
</route>
<!-- Unmarshal message from XML -->
<route>
<from uri="direct:unmarshal"/>
<unmarshal ref="jibx"/>
<to uri="mock:result"/>
</route>
</camelContext>