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