Camel has support for message transformation using several techniques. One such technique is Data Formats, where marshal and unmarshal comes from.
Marshal - Transforms the message body (such as Java object) into a binary or textual format, ready to be wired over the network.
Unmarshal - Transforms data in some binary or textual format (such as received over the network) into a Java object; or some other representation according to the data format being used.
Then the reverse operation happens to transform the Java objects back into XML also via JAXB, but using the
unmarshal operation. And finally the message is routed to a JMS queue.
from("file:inbox/xml") .marshal().jaxb() .to("bean:validateOrder") .unmarshal().jaxb() .to("jms:queue:order");
And in XML:
<route> <from uri="file:inbox/xml"/> <marshal><jaxb/></marshal> <to uri="bean:validateOrder"/> <unmarshal><jaxb/></unmarshal> <to uri="jms:queue:order"/> </route>