Camel JMS : consume a message(is an xml) from topic and invoke a java bean and pass the xml object to it

StackOverflow https://stackoverflow.com/questions/22313261

Вопрос

I have a camel route which is supposed to consume a JMS message from a topic and invoke a spring bean. Route definition

from("jms:topic:testQueue?transacted=true&connectionFactory=#myJmsConnectionFactory&messageConverter=#myMessageConverter")
.autoStartup("true")
.to("bean:myService?method=consumeJMSMessage")
.routeId("myRouteId.consumeJMSMessages");

My question is that where is the xml read and where can i access it, not sure how to pass it to my service method consumeJMSMessage() which currently takes no arguments?

Appreciate any help on this.

Regards, Rahul

Это было полезно?

Решение

As specified in from clause; you are using myMessageConverter bean. Camel looks up the specified bean from spring application context. This bean needs to implement the MessageConverter interface. So if you need to customize conversion of JMS message to XML dom then you need to implement a bean implementing this interface.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top