You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by PankajGupte <p....@accenture.com> on 2014/02/21 15:54:51 UTC

Not getting response back when splitter and agreegator pattern implemented in camel

Can you please advice on  below issue I am facing while using camel for
implementing splitter/ aggregator pattern
 
I am using producer template to invoke the route like below 
 
response = template.requestBody("direct:start5",req,String.class);
 
My route is like below 
 
from("direct:start5").setHeader(Exchange.HTTP_METHOD,constant("GET")).setHeader(Exchange.HTTP_QUERY,
body()).split(body(String.class).tokenize("}")).process(new
SplitProcessor()).to(property).aggregate(SpliterStratergy).header(Exchange.HTTP_METHOD).ignoreInvalidCorrelationKeys().completionSize(4).to(agre);
 
As per this route Camel splits my request and the call goes to
SpliterStratergy for each splited part.
In this class I am aggregating the response for all splits 
 
The final out put can be sent on the next point in the route.
 
How ever I am not getting the final response back on the response variable.
 
For any other EP I am getting data back in the response variable
 
Can you explain how to solve this issue.
I can solve this issue by putting the final output on mock end point and
then using consumer to read data However expectation in real life production
enviroment is to get data back from producer template's request method 
 
Regards
Pankaj




--
View this message in context: http://camel.465427.n5.nabble.com/Not-getting-response-back-when-splitter-and-agreegator-pattern-implemented-in-camel-tp5747763.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Not getting response back when splitter and agreegator pattern implemented in camel

Posted by Claus Ibsen <cl...@gmail.com>.
Hi

Sounds like you need this EIP instead
http://camel.apache.org/composed-message-processor.html

And look for the splitter only example how to do that.

On Fri, Feb 21, 2014 at 3:54 PM, PankajGupte
<p....@accenture.com> wrote:
> Can you please advice on  below issue I am facing while using camel for
> implementing splitter/ aggregator pattern
>
> I am using producer template to invoke the route like below
>
> response = template.requestBody("direct:start5",req,String.class);
>
> My route is like below
>
> from("direct:start5").setHeader(Exchange.HTTP_METHOD,constant("GET")).setHeader(Exchange.HTTP_QUERY,
> body()).split(body(String.class).tokenize("}")).process(new
> SplitProcessor()).to(property).aggregate(SpliterStratergy).header(Exchange.HTTP_METHOD).ignoreInvalidCorrelationKeys().completionSize(4).to(agre);
>
> As per this route Camel splits my request and the call goes to
> SpliterStratergy for each splited part.
> In this class I am aggregating the response for all splits
>
> The final out put can be sent on the next point in the route.
>
> How ever I am not getting the final response back on the response variable.
>
> For any other EP I am getting data back in the response variable
>
> Can you explain how to solve this issue.
> I can solve this issue by putting the final output on mock end point and
> then using consumer to read data However expectation in real life production
> enviroment is to get data back from producer template's request method
>
> Regards
> Pankaj
>
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Not-getting-response-back-when-splitter-and-agreegator-pattern-implemented-in-camel-tp5747763.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
Red Hat, Inc.
Email: cibsen@redhat.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen
Make your Camel applications look hawt, try: http://hawt.io

Re: Not getting response back when splitter and agreegator pattern implemented in camel

Posted by Claus Ibsen <cl...@gmail.com>.
See that link, and the splitter only example, eg you can do fork/join
work easily.

On Mon, Feb 24, 2014 at 3:59 AM, PankajGupte
<p....@accenture.com> wrote:
> Thanks a Lot for your time,
>
> I have implemented this pattern and facing one issue please clarify below
>
> After the final output is created by AgreegationStratergy class will
> producer template's request body and header method will return it as
> response
>
> Or
>
> I need to drop this output on some endpoint and retrive it by some
> mechanisum.
>
> As per your reply i should look at below link
> http://camel.apache.org/composed-message-processor.html
> which talks about sending output to mock end point and retriving it from
> there by second route
>
> Please confrim
>
>
>
>
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Not-getting-response-back-when-splitter-and-agreegator-pattern-implemented-in-camel-tp5747763p5747837.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
Red Hat, Inc.
Email: cibsen@redhat.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen
Make your Camel applications look hawt, try: http://hawt.io

Re: Not getting response back when splitter and agreegator pattern implemented in camel

Posted by PankajGupte <p....@accenture.com>.
Thanks a Lot for your time,

I have implemented this pattern and facing one issue please clarify below 

After the final output is created by AgreegationStratergy class will
producer template's request body and header method will return it as
response 

Or 

I need to drop this output on some endpoint and retrive it by some
mechanisum.

As per your reply i should look at below link 
http://camel.apache.org/composed-message-processor.html
which talks about sending output to mock end point and retriving it from
there by second route 

Please confrim

 

 



--
View this message in context: http://camel.465427.n5.nabble.com/Not-getting-response-back-when-splitter-and-agreegator-pattern-implemented-in-camel-tp5747763p5747837.html
Sent from the Camel - Users mailing list archive at Nabble.com.