You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Raphaël Delaporte <ra...@gmail.com> on 2010/01/12 18:09:22 UTC

Pipeline behaviour

Hi,

There is something I do not understand in the Pipeline processor.
Let's consider the following route declaration :

  from("seda:pipeline").pipeline("seda:rs1","seda:rs2","seda:rs3");

  ChangeBody cb = new ChangeBody();
  from("seda:rs1").bean(cb);
  from("seda:rs2").bean(cb);
  from("seda:rs3").bean(cb).to("log:pipeline?showAll=true");


  With ChangeBody, a simple bean to concat twice body.
  static public class ChangeBody{
      public String change(@Body String body) throws Exception {
          return body + body;
      }
  }


For example, if I inject the "a" body message, I would expect to have
"aaaaaaaa"(2*2*2) in the log message, but I've just got "aa".
What have I miss ? (I'm using 1.6.0 version since I use Camel in SMX 3.3).

Thanks all.
Raphaël

Re: Pipeline behaviour

Posted by Willem Jiang <wi...@gmail.com>.
Here are seach box in the right side of the camel.apache.org home page,
Basically, you can find what you want that :)

Willem

Raphaël Delaporte wrote:
> Thanks !
> There are so much docs and links on the website that sometimes this is
> difficult to find the information !
> But it's better like this :)
> 
> Well, thanks a lot !
> 
> Raphaël
> 
> 
> 2010/1/12 Claus Ibsen <cl...@gmail.com>
> 
>> 2010/1/12 Raphaël Delaporte <ra...@gmail.com>:
>>> Hi,
>>>
>>> Ok, it works with direct: component. Does it mean the seda: component is
>>> InOnly in Camel 1.x ?
>> Yes read more about that at its wiki page
>> http://camel.apache.org/seda.html
>>
>>
>>> For my information, does Camel 2.x wait for the reply with seda:
>> components
>>> ?
>>>
>> See the wiki page. Yes it does if needed = InOut. There is also an
>> option to control the behavior.
>>
>>
>>> How can I set an InOnly MEP on one of the route called by the pipeline,
>>> direct:rs1 for example ?
>>>
>>  from("direct:rs1").setExchangePattern(ExchangePattern.InOnly).bean(cb).to(LOG);
>>> ?
>>>
>> Read about InOut aka Request/Reply here
>> http://camel.apache.org/request-reply.html
>>
>>> Thank you very much for your help !
>>> Raphaël
>>>
>>>
>>> 2010/1/12 Claus Ibsen <cl...@gmail.com>
>>>
>>>> Hi
>>>>
>>>> Use direct:rs1 ... rs3 instead of seda as Camel 1.x does not wait for
>>>> the "reply" so to speak.
>>>>
>>>> And it does depend which MEP you use. InOnly or InOut etc.
>>>>
>>>>
>>>> 2010/1/12 Raphaël Delaporte <ra...@gmail.com>:
>>>>> Hi,
>>>>>
>>>>> There is something I do not understand in the Pipeline processor.
>>>>> Let's consider the following route declaration :
>>>>>
>>>>>  from("seda:pipeline").pipeline("seda:rs1","seda:rs2","seda:rs3");
>>>>>
>>>>>  ChangeBody cb = new ChangeBody();
>>>>>  from("seda:rs1").bean(cb);
>>>>>  from("seda:rs2").bean(cb);
>>>>>  from("seda:rs3").bean(cb).to("log:pipeline?showAll=true");
>>>>>
>>>>>
>>>>>  With ChangeBody, a simple bean to concat twice body.
>>>>>  static public class ChangeBody{
>>>>>      public String change(@Body String body) throws Exception {
>>>>>          return body + body;
>>>>>      }
>>>>>  }
>>>>>
>>>>>
>>>>> For example, if I inject the "a" body message, I would expect to have
>>>>> "aaaaaaaa"(2*2*2) in the log message, but I've just got "aa".
>>>>> What have I miss ? (I'm using 1.6.0 version since I use Camel in SMX
>>>> 3.3).
>>>>> Thanks all.
>>>>> Raphaël
>>>>>
>>>>
>>>>
>>>> --
>>>> Claus Ibsen
>>>> Apache Camel Committer
>>>>
>>>> Author of Camel in Action: http://www.manning.com/ibsen/
>>>> Open Source Integration: http://fusesource.com
>>>> Blog: http://davsclaus.blogspot.com/
>>>> Twitter: http://twitter.com/davsclaus
>>>>
>>
>>
>> --
>> Claus Ibsen
>> Apache Camel Committer
>>
>> Author of Camel in Action: http://www.manning.com/ibsen/
>> Open Source Integration: http://fusesource.com
>> Blog: http://davsclaus.blogspot.com/
>> Twitter: http://twitter.com/davsclaus
>>
> 


Re: Pipeline behaviour

Posted by Raphaël Delaporte <ra...@gmail.com>.
Thanks !
There are so much docs and links on the website that sometimes this is
difficult to find the information !
But it's better like this :)

Well, thanks a lot !

Raphaël


2010/1/12 Claus Ibsen <cl...@gmail.com>

> 2010/1/12 Raphaël Delaporte <ra...@gmail.com>:
> > Hi,
> >
> > Ok, it works with direct: component. Does it mean the seda: component is
> > InOnly in Camel 1.x ?
>
> Yes read more about that at its wiki page
> http://camel.apache.org/seda.html
>
>
> > For my information, does Camel 2.x wait for the reply with seda:
> components
> > ?
> >
>
> See the wiki page. Yes it does if needed = InOut. There is also an
> option to control the behavior.
>
>
> >
> > How can I set an InOnly MEP on one of the route called by the pipeline,
> > direct:rs1 for example ?
> >
>  from("direct:rs1").setExchangePattern(ExchangePattern.InOnly).bean(cb).to(LOG);
> > ?
> >
>
> Read about InOut aka Request/Reply here
> http://camel.apache.org/request-reply.html
>
> >
> > Thank you very much for your help !
> > Raphaël
> >
> >
> > 2010/1/12 Claus Ibsen <cl...@gmail.com>
> >
> >> Hi
> >>
> >> Use direct:rs1 ... rs3 instead of seda as Camel 1.x does not wait for
> >> the "reply" so to speak.
> >>
> >> And it does depend which MEP you use. InOnly or InOut etc.
> >>
> >>
> >> 2010/1/12 Raphaël Delaporte <ra...@gmail.com>:
> >> > Hi,
> >> >
> >> > There is something I do not understand in the Pipeline processor.
> >> > Let's consider the following route declaration :
> >> >
> >> >  from("seda:pipeline").pipeline("seda:rs1","seda:rs2","seda:rs3");
> >> >
> >> >  ChangeBody cb = new ChangeBody();
> >> >  from("seda:rs1").bean(cb);
> >> >  from("seda:rs2").bean(cb);
> >> >  from("seda:rs3").bean(cb).to("log:pipeline?showAll=true");
> >> >
> >> >
> >> >  With ChangeBody, a simple bean to concat twice body.
> >> >  static public class ChangeBody{
> >> >      public String change(@Body String body) throws Exception {
> >> >          return body + body;
> >> >      }
> >> >  }
> >> >
> >> >
> >> > For example, if I inject the "a" body message, I would expect to have
> >> > "aaaaaaaa"(2*2*2) in the log message, but I've just got "aa".
> >> > What have I miss ? (I'm using 1.6.0 version since I use Camel in SMX
> >> 3.3).
> >> >
> >> > Thanks all.
> >> > Raphaël
> >> >
> >>
> >>
> >>
> >> --
> >> Claus Ibsen
> >> Apache Camel Committer
> >>
> >> Author of Camel in Action: http://www.manning.com/ibsen/
> >> Open Source Integration: http://fusesource.com
> >> Blog: http://davsclaus.blogspot.com/
> >> Twitter: http://twitter.com/davsclaus
> >>
> >
>
>
>
> --
> Claus Ibsen
> Apache Camel Committer
>
> Author of Camel in Action: http://www.manning.com/ibsen/
> Open Source Integration: http://fusesource.com
> Blog: http://davsclaus.blogspot.com/
> Twitter: http://twitter.com/davsclaus
>

Re: Pipeline behaviour

Posted by Claus Ibsen <cl...@gmail.com>.
2010/1/12 Raphaël Delaporte <ra...@gmail.com>:
> Hi,
>
> Ok, it works with direct: component. Does it mean the seda: component is
> InOnly in Camel 1.x ?

Yes read more about that at its wiki page
http://camel.apache.org/seda.html


> For my information, does Camel 2.x wait for the reply with seda: components
> ?
>

See the wiki page. Yes it does if needed = InOut. There is also an
option to control the behavior.


>
> How can I set an InOnly MEP on one of the route called by the pipeline,
> direct:rs1 for example ?
>  from("direct:rs1").setExchangePattern(ExchangePattern.InOnly).bean(cb).to(LOG);
> ?
>

Read about InOut aka Request/Reply here
http://camel.apache.org/request-reply.html

>
> Thank you very much for your help !
> Raphaël
>
>
> 2010/1/12 Claus Ibsen <cl...@gmail.com>
>
>> Hi
>>
>> Use direct:rs1 ... rs3 instead of seda as Camel 1.x does not wait for
>> the "reply" so to speak.
>>
>> And it does depend which MEP you use. InOnly or InOut etc.
>>
>>
>> 2010/1/12 Raphaël Delaporte <ra...@gmail.com>:
>> > Hi,
>> >
>> > There is something I do not understand in the Pipeline processor.
>> > Let's consider the following route declaration :
>> >
>> >  from("seda:pipeline").pipeline("seda:rs1","seda:rs2","seda:rs3");
>> >
>> >  ChangeBody cb = new ChangeBody();
>> >  from("seda:rs1").bean(cb);
>> >  from("seda:rs2").bean(cb);
>> >  from("seda:rs3").bean(cb).to("log:pipeline?showAll=true");
>> >
>> >
>> >  With ChangeBody, a simple bean to concat twice body.
>> >  static public class ChangeBody{
>> >      public String change(@Body String body) throws Exception {
>> >          return body + body;
>> >      }
>> >  }
>> >
>> >
>> > For example, if I inject the "a" body message, I would expect to have
>> > "aaaaaaaa"(2*2*2) in the log message, but I've just got "aa".
>> > What have I miss ? (I'm using 1.6.0 version since I use Camel in SMX
>> 3.3).
>> >
>> > Thanks all.
>> > Raphaël
>> >
>>
>>
>>
>> --
>> Claus Ibsen
>> Apache Camel Committer
>>
>> Author of Camel in Action: http://www.manning.com/ibsen/
>> Open Source Integration: http://fusesource.com
>> Blog: http://davsclaus.blogspot.com/
>> Twitter: http://twitter.com/davsclaus
>>
>



-- 
Claus Ibsen
Apache Camel Committer

Author of Camel in Action: http://www.manning.com/ibsen/
Open Source Integration: http://fusesource.com
Blog: http://davsclaus.blogspot.com/
Twitter: http://twitter.com/davsclaus

Re: Pipeline behaviour

Posted by Raphaël Delaporte <ra...@gmail.com>.
Hi,

Ok, it works with direct: component. Does it mean the seda: component is
InOnly in Camel 1.x ?
For my information, does Camel 2.x wait for the reply with seda: components
?


How can I set an InOnly MEP on one of the route called by the pipeline,
direct:rs1 for example ?
 from("direct:rs1").setExchangePattern(ExchangePattern.InOnly).bean(cb).to(LOG);
?


Thank you very much for your help !
Raphaël


2010/1/12 Claus Ibsen <cl...@gmail.com>

> Hi
>
> Use direct:rs1 ... rs3 instead of seda as Camel 1.x does not wait for
> the "reply" so to speak.
>
> And it does depend which MEP you use. InOnly or InOut etc.
>
>
> 2010/1/12 Raphaël Delaporte <ra...@gmail.com>:
> > Hi,
> >
> > There is something I do not understand in the Pipeline processor.
> > Let's consider the following route declaration :
> >
> >  from("seda:pipeline").pipeline("seda:rs1","seda:rs2","seda:rs3");
> >
> >  ChangeBody cb = new ChangeBody();
> >  from("seda:rs1").bean(cb);
> >  from("seda:rs2").bean(cb);
> >  from("seda:rs3").bean(cb).to("log:pipeline?showAll=true");
> >
> >
> >  With ChangeBody, a simple bean to concat twice body.
> >  static public class ChangeBody{
> >      public String change(@Body String body) throws Exception {
> >          return body + body;
> >      }
> >  }
> >
> >
> > For example, if I inject the "a" body message, I would expect to have
> > "aaaaaaaa"(2*2*2) in the log message, but I've just got "aa".
> > What have I miss ? (I'm using 1.6.0 version since I use Camel in SMX
> 3.3).
> >
> > Thanks all.
> > Raphaël
> >
>
>
>
> --
> Claus Ibsen
> Apache Camel Committer
>
> Author of Camel in Action: http://www.manning.com/ibsen/
> Open Source Integration: http://fusesource.com
> Blog: http://davsclaus.blogspot.com/
> Twitter: http://twitter.com/davsclaus
>

Re: Pipeline behaviour

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

Use direct:rs1 ... rs3 instead of seda as Camel 1.x does not wait for
the "reply" so to speak.

And it does depend which MEP you use. InOnly or InOut etc.


2010/1/12 Raphaël Delaporte <ra...@gmail.com>:
> Hi,
>
> There is something I do not understand in the Pipeline processor.
> Let's consider the following route declaration :
>
>  from("seda:pipeline").pipeline("seda:rs1","seda:rs2","seda:rs3");
>
>  ChangeBody cb = new ChangeBody();
>  from("seda:rs1").bean(cb);
>  from("seda:rs2").bean(cb);
>  from("seda:rs3").bean(cb).to("log:pipeline?showAll=true");
>
>
>  With ChangeBody, a simple bean to concat twice body.
>  static public class ChangeBody{
>      public String change(@Body String body) throws Exception {
>          return body + body;
>      }
>  }
>
>
> For example, if I inject the "a" body message, I would expect to have
> "aaaaaaaa"(2*2*2) in the log message, but I've just got "aa".
> What have I miss ? (I'm using 1.6.0 version since I use Camel in SMX 3.3).
>
> Thanks all.
> Raphaël
>



-- 
Claus Ibsen
Apache Camel Committer

Author of Camel in Action: http://www.manning.com/ibsen/
Open Source Integration: http://fusesource.com
Blog: http://davsclaus.blogspot.com/
Twitter: http://twitter.com/davsclaus