By guessing, I suppose that you're going to use the camelTemplate to send
stuff to "direct:start",
It is enough to do something like:
                ProducerTemplate camelTemplate =
(ProducerTemplate)context.getBean("template");
                Object returnValue = camelTemplate.requestBody("direct:start");
By just calling requestBody instead of sendBody, you're effectively setting
the InOut mep, so when the message reaches the jms endpoint, it will expect
the message broker to come up with a reply, and send back the message to the
caller i.e. returnValue in the snippet above.
One thing I don't get in your route, is the "bean:myListener", I am curious
to know if what is sent back from the "infratest" queue gets send to the
next bean component and finally is sent back to the call initiated by the
camelTemplate...
HTH.


yaog wrote:
> 
> Hi,
> 
> I have a route like this:
> 
> <camelContext id="camel" trace="true"
> xmlns="http://camel.apache.org/schema/spring";>
>               <camel:template id="camelTemplate" />
>               <route>
>                       <from uri="direct:start" />
>                       <to uri="bean:compA?method=start1" />                   
>                       <to uri="bean:compB" />
>                       <to uri="bean:myRMIClient1"/>
>                       <to uri="jms:infratest"/>                       
>                       <to uri="bean:myListener" />
>               </route>
>       </camelContext>
> 
> 
> On the one hand in the end I send a jms message. On the other hand I want
> an InOut pattern so my main will get back the result from
> "bean:myRMIClient1".
> 
> Can anyone advise how can this be achieved?
> 
> 
> 

-- 
View this message in context: 
http://old.nabble.com/How-to-InOut-with-JMs-tp26965017p26965755.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Reply via email to