You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Sura Monday <su...@yahoo.com> on 2012/09/13 08:36:37 UTC

how to decide the exchagne pattern of the route

Hi All,
I have an exchange pattern like the one shown below:

from("jason:action").inOut("jms:validate);                

from("jms:validate").bean(ValidatorBean.class);

At my jason end point, if I print out [endpoint].getExchangePattern(), it returns inOnly. 


Why doesn't getExchangePattern() return inOut, as it should do? Or is there another method that returns inOut?

/Sura

Re: how to decide the exchagne pattern of the route

Posted by Ashwin Karpe <ak...@fusesource.com>.
Hi,

Please check out the section "Request-reply over JMS" in the Camel JMS
component documentation. Note the following

"In essence the MEP of the Exchange should be InOut when you send a message
to a JMS queue."

Camel uses temporary replyTo Queue to send responses back from a JMS
Consumer.

"A temporary queue is used as reply queue, and automatically created by
Camel. To use this do not specify a replyTo queue name. And you can
optionally configure replyToType=Temporary to make it stand out that
temporary queues are in use."

The question then becomes whether the JMS Producer set up to expect a
response back. This is where the InOut MEP matters...
 
"The JmsProducer detects the InOut and provides a JMSReplyTo header with the
reply destination to be used. By default Camel uses a temporary queue, but
you can use the replyTo option on the endpoint to specify a fixed reply
queue (see more below about fixed reply queue)."

Hopefully this clears everything up for you.

Cheers,

Ashwin...  



-----
---------------------------------------------------------
Ashwin Karpe
Apache Camel Committer & Sr Principal Consultant
FUSESource (a Progress Software Corporation subsidiary)
http://fusesource.com 

Blog: http://opensourceknowledge.blogspot.com 
---------------------------------------------------------
--
View this message in context: http://camel.465427.n5.nabble.com/how-to-decide-the-exchagne-pattern-of-the-route-tp5719231p5719245.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: how to decide the exchagne pattern of the route

Posted by Claus Ibsen <cl...@gmail.com>.
On Thu, Sep 13, 2012 at 9:11 AM, Sura Monday <su...@yahoo.com> wrote:
> Hi Claus,
> Thanks. So if I want my jason component to receive responses from jms, do I always have to set the jms consumer MEP to inout as well? why do we have to explicitly set consumer MEP, if the route already says i is inout? Isnt there any method to get the MEP that is set on the route?
>

The Camel JMS component supports both InOnly and InOut. So you have to
set the MEP accordingly what you want. See the EIPs
http://camel.apache.org/event-message.html
http://camel.apache.org/request-reply.html


> Also, how can I retrieve the response message at my jason consumer?
>

This is component specific. There is no jason component out of  the
box at Apache Camel. So its likely a custom component. So get in touch
with the component author to figure that out.

> /Sura
>
>
>
> ________________________________
>  From: Claus Ibsen <cl...@gmail.com>
> To: users@camel.apache.org
> Sent: Thursday, September 13, 2012 6:54 PM
> Subject: Re: how to decide the exchagne pattern of the route
>
> On Thu, Sep 13, 2012 at 8:36 AM, Sura Monday <su...@yahoo.com> wrote:
>> Hi All,
>> I have an exchange pattern like the one shown below:
>>
>> from("jason:action").inOut("jms:validate);
>>
>> from("jms:validate").bean(ValidatorBean.class);
>>
>> At my jason end point, if I print out [endpoint].getExchangePattern(), it returns inOnly.
>>
>>
>> Why doesn't getExchangePattern() return inOut, as it should do? Or is there another method that returns inOut?
>>
>
> Its the jason component, in its consumer that decides the initial MEP.
> By default its InOnly and hence why it may report that.
> The component writer must handle this to set the correct MEP.
>
>> /Sura
>
>
>
> --
> Claus Ibsen
> -----------------
> FuseSource
> Email: cibsen@fusesource.com
> Web: http://fusesource.com
> Twitter: davsclaus, fusenews
> Blog: http://davsclaus.com
> Author of Camel in Action: http://www.manning.com/ibsen



-- 
Claus Ibsen
-----------------
FuseSource
Email: cibsen@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus, fusenews
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen

Re: how to decide the exchagne pattern of the route

Posted by Sura Monday <su...@yahoo.com>.
Hi Claus,
Thanks. So if I want my jason component to receive responses from jms, do I always have to set the jms consumer MEP to inout as well? why do we have to explicitly set consumer MEP, if the route already says i is inout? Isnt there any method to get the MEP that is set on the route?

Also, how can I retrieve the response message at my jason consumer?

/Sura



________________________________
 From: Claus Ibsen <cl...@gmail.com>
To: users@camel.apache.org 
Sent: Thursday, September 13, 2012 6:54 PM
Subject: Re: how to decide the exchagne pattern of the route
 
On Thu, Sep 13, 2012 at 8:36 AM, Sura Monday <su...@yahoo.com> wrote:
> Hi All,
> I have an exchange pattern like the one shown below:
>
> from("jason:action").inOut("jms:validate);
>
> from("jms:validate").bean(ValidatorBean.class);
>
> At my jason end point, if I print out [endpoint].getExchangePattern(), it returns inOnly.
>
>
> Why doesn't getExchangePattern() return inOut, as it should do? Or is there another method that returns inOut?
>

Its the jason component, in its consumer that decides the initial MEP.
By default its InOnly and hence why it may report that.
The component writer must handle this to set the correct MEP.

> /Sura



-- 
Claus Ibsen
-----------------
FuseSource
Email: cibsen@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus, fusenews
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen

Re: how to decide the exchagne pattern of the route

Posted by Claus Ibsen <cl...@gmail.com>.
On Thu, Sep 13, 2012 at 8:36 AM, Sura Monday <su...@yahoo.com> wrote:
> Hi All,
> I have an exchange pattern like the one shown below:
>
> from("jason:action").inOut("jms:validate);
>
> from("jms:validate").bean(ValidatorBean.class);
>
> At my jason end point, if I print out [endpoint].getExchangePattern(), it returns inOnly.
>
>
> Why doesn't getExchangePattern() return inOut, as it should do? Or is there another method that returns inOut?
>

Its the jason component, in its consumer that decides the initial MEP.
By default its InOnly and hence why it may report that.
The component writer must handle this to set the correct MEP.

> /Sura



-- 
Claus Ibsen
-----------------
FuseSource
Email: cibsen@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus, fusenews
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen