176.3. JiBX Spring DSL
Camel Spring DSL 还支持 Jibx 数据格式。
<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>