This content has been marked as final.
Show 2 replies
-
1. Re: ProducerTemplate + jaxb?
davsclaus Aug 13, 2011 2:31 AM (in response to jamie3_james.archibald)When you send to the activemq queue, you can tell it to use a javax.jms.TextMessage which forces Camel to automatic marshal JAXB -> String.
Set the jmsMessageType=Text option
template.requestBody("activemq:database?jmsMessageType=Text", obj);
Make sure you have camel-jaxb on the classpath for this to work.
-
2. Re: ProducerTemplate + jaxb?
jamie3_james.archibald Aug 15, 2011 10:34 AM (in response to davsclaus)I was able to get this to work using jmsMessageType=TEXT however I found out this does not work when the JAXB converter needs to be configured as follows:
JaxbDataFormat jaxb = new JaxbDataFormat(MyObject.class.getPackage().getName());
jaxb.setPartClass(MyObject.class.getName());
jaxb.setPartNamespace(new QName("urn:someNamespace/MyObject.xsd","",""));
Edited by: jamie3 on Aug 15, 2011 2:33 PM