Perhaps I did not make this clear enough. You should not use from(jms) and to(jms) in the same route.

Simply send for example like this:
from("direct:test1").to("jms:queue:MyQ")

The to part will automatically send a message, set the replyTo, open a temp queue for the reply, wait for a reply, receive it and return it an set it as the new body.


Then in your main route your simply do
from("jms:queue:MyQ").process(...)

This simple from listens on MyQ for messages, sets the message as body on the route, Forwards to the next processor. Then at the end of the route the body that is in the message is given back to the from which sends the content to the queue named in the jmsReplyTo header of the orig message.

So to put it shortly just use a single to(jms) to send and receive and use a single from(jms) to receive and send back the reply.

Christian

On 29.05.2014 09:57, Tomas wrote:
Hi Christian, thank you for the reply.

Yes, I can add a processor in between and send it back to MyQ like this:

from("jms:queue:MyQ").process(...).to("jms:queue:MyQ");

But this is not what I need. I want to listen to the MyQ, receive it and
then send a new message as a reply to the destination defined by JMSReplyTo
(which was already set my Camel's InOut) and of course bind the request map
to the replies by JMSCorrelationId (set by Camel as well).




--
View this message in context: 
http://camel.465427.n5.nabble.com/Request-reply-JMS-ActiveMQ-tp5751686p5751689.html
Sent from the Camel - Users mailing list archive at Nabble.com.


--
Christian Schneider
http://www.liquid-reality.de

Open Source Architect
http://www.talend.com

Reply via email to