Wednesday, 10 December 2014

Spring JMSListener and JAXB marshalling



i have a JMS "endpoint" like this:



@JmsListener(destination = "TestQueue")
public void doSomething(MyJaxbAnnotatedClass myclass) {
}


Of course with the needed applicationContext configuration like <jms:annotation-driven/> and the likes. All this worked when my method signature was only a



public void doSomething(String xmlString)


But i want to have automatic unmarshalling done by Spring like i do it with JSON in the Spring-MVC context. But somehow Spring needs more configuration for this to happen, because i get the following stacktrace when trying the MyJaxbAnnotatedClass paramter:



Caused by: org.springframework.messaging.converter.MessageConversionException: No converter found to convert to class de.xxx.xxx.MyJaxbAnnotatedClass, message=GenericMessage [payload=<BRNArtikelStamm:EcomxProducts
xmlns:BRNfoo="http://ift.tt/1zPqYKX"


So i assume i must somehow tell Spring how to unmarshal? Since JAXB is a pretty common way of doing serialization, i hope there is a common config which needs to be applied.


THanks for any input.


No comments:

Post a Comment