I am using camel with JMS. I have a route, which just puts the jaxb annoted java object on a mq. The java object doesn't implement serializable, it just has "serialVersionUID".
The issue is, the object gets converted to XML and the destination queue has a XML message of type MQSTR. Is this the default behavior? Should we rely on it to do this all the time? Please note we are not using any marshal or unmarshal from java dsl and if we remove the jaxb dependency from pom.xml, it doesn't get converted to xml.
My route is plain vanila like this.
from("someRoute")
.setExchangePattern(ExchangePattern.InOnly)
.doTry().processRef("processor")
.inOnly("destinationQueue")
.doCatch(Exception.class)
.to("errorQueue");
The processor populates the jaxb class and sets it to body. My processor code is like this
JaxbClass message = mapper.mapHL7ToXML(hl7Message);
exchange.getIn().setBody(message) ;
I am currently using this as dependency in pom for jaxb.
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-jaxb</artifactId>
<version>2.10.3</version>
</dependency>