You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Christian Müller <ch...@gmail.com> on 2012/09/30 11:58:07 UTC

Re: Camel JMS Request Reply

Can you try:

from("activemq:queue:EVENTS")
    .multicast(new Aggregation())
        .inOut("activemq:queue:Test1", "bean:getDummyString");

from("activemq:queue:Test1?exchangePattern")
    .process(new Processor() {
        public void process(Exchange exchange) throws Exception {
            exchange.getIn().setBody("Changed the exchange hello world");
        }});

By using the inOut MEP in JMS, Camel will create by default a temp. Queue
for the response. This is the recommended and fasted approach.
And read this FAQ about using getIn() or getOut():
http://camel.apache.org/using-getin-or-getout-methods-on-exchange.html

Best,
Christian

On Sat, Sep 29, 2012 at 10:24 PM, ravi.4indra <ra...@gmail.com> wrote:

> Hi ,
>
> I need some help with camel JMS Request reply (InOUT)
>
> I want my aggregation method to generate new exchange from replyMessage(it
> is the meesage in replyto Queue/response for my request message) and a
> dummy
> bean which returns a object.
>
> can the aggregationStartegy get the message from replyTo Queue?. Is there a
> way to force the camel to return the message from replytoQueue.
> Any Help is appreciated.
>
> Thanks
> Ravi
> below is the code i am tryiing
>
> public void configure() throws Exception {
>
> from("activemq:queue:EVENTS").multicast(new
>
> Aggregation()).to("activemq:queue:Test1?replyTo=queue:Test3&exchangePattern=InOut&replyToType=Exclusive","bean:getDummyString");
>
> from("activemq:queue:Test1?exchangePattern").process(
>                         new Processor() {
>                          public void process(Exchange exchange) throws
> Exception {
>                                  exchange.getOut().setBody("Changed the
> exchange hello
> world");
>                          }
> }).to("activemq:queue:Test3");
>
> }
>
>
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Camel-JMS-Request-Reply-tp5720247.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>



--

Re: Camel JMS Request Reply

Posted by Christian Müller <ch...@gmail.com>.
I found a typo (the "?exchangePattern" is not necessary):

from("activemq:queue:EVENTS")
    .multicast(new Aggregation())
    .inOut("activemq:queue:Test1", "bean:getDummyString");

from("activemq:queue:Test1")
    .process(new Processor() {
        public void process(Exchange exchange) throws Exception {
            exchange.getIn().setBody("Changed the exchange hello world");
        }});

Best,
Christian

On Sun, Sep 30, 2012 at 11:58 AM, Christian Müller <
christian.mueller@gmail.com> wrote:

> Can you try:
>
> from("activemq:queue:EVENTS")
>     .multicast(new Aggregation())
>         .inOut("activemq:queue:Test1", "bean:getDummyString");
>
>
> from("activemq:queue:Test1?exchangePattern")
>     .process(new Processor() {
>         public void process(Exchange exchange) throws Exception {
>             exchange.getIn().setBody("Changed the exchange hello world");
>         }});
>
> By using the inOut MEP in JMS, Camel will create by default a temp. Queue
> for the response. This is the recommended and fasted approach.
> And read this FAQ about using getIn() or getOut():
> http://camel.apache.org/using-getin-or-getout-methods-on-exchange.html
>
> Best,
> Christian
>
>
> On Sat, Sep 29, 2012 at 10:24 PM, ravi.4indra <ra...@gmail.com>wrote:
>
>> Hi ,
>>
>> I need some help with camel JMS Request reply (InOUT)
>>
>> I want my aggregation method to generate new exchange from replyMessage(it
>> is the meesage in replyto Queue/response for my request message) and a
>> dummy
>> bean which returns a object.
>>
>> can the aggregationStartegy get the message from replyTo Queue?. Is there
>> a
>> way to force the camel to return the message from replytoQueue.
>> Any Help is appreciated.
>>
>> Thanks
>> Ravi
>> below is the code i am tryiing
>>
>> public void configure() throws Exception {
>>
>> from("activemq:queue:EVENTS").multicast(new
>>
>> Aggregation()).to("activemq:queue:Test1?replyTo=queue:Test3&exchangePattern=InOut&replyToType=Exclusive","bean:getDummyString");
>>
>> from("activemq:queue:Test1?exchangePattern").process(
>>                         new Processor() {
>>                          public void process(Exchange exchange) throws
>> Exception {
>>                                  exchange.getOut().setBody("Changed the
>> exchange hello
>> world");
>>                          }
>> }).to("activemq:queue:Test3");
>>
>> }
>>
>>
>>
>>
>>
>> --
>> View this message in context:
>> http://camel.465427.n5.nabble.com/Camel-JMS-Request-Reply-tp5720247.html
>> Sent from the Camel - Users mailing list archive at Nabble.com.
>>
>
>
>
> --
>
>
>


--