Hi,

I saw your previous mail, and from what you are saying the result seems to be 
incorrect.
We are now trying to get the 2.5.0 release out. Will take a look as soon as I 
am done with the release.

Thanks for the patience and for using camel,
Hadrian

On Oct 25, 2010, at 6:45 AM, ext2 wrote:

> Hi: 
> 
> Here is a simple route,  I think it's result should be  6, but the result is
> 2;
> 
> 
> 
> from("direct:start2").multicast(new SumAggregateBean())
> 
>    .pipeline().transform(BeanLanguage.bean(IncreaseOne.class)).bean(new
> IncreaseTwo()).end()
> 
>    .pipeline().transform(BeanLanguage.bean(IncreaseOne.class)).bean(new
> IncreaseTwo()).end()
> 
> .end()
> 
> .to("mock:result2");
> 
> 
> 
> 
> 
> In this route, IncreaseOne just add the input by one, IncreaseTwo: just add
> the input by two;  The SumAggregateBean just add sum the input integer.
> 
> If I send number 0 to the route, I think each pipe line 's result should be
> 0+1+2=3, and final result of route should be 3+3=6; but the result is 2; 
> 
> 
> 
> Why? Is it a bug?
> 
> 
> 
> Following is the source code of IncreaseOne, IncreaseTwo, and
> SumAggregateBeans;
> 
> 
> 
> 
> 
> 
> 
> public static class IncreaseOne{
> 
>       public int increase(int v)
> 
>       {
> 
>           return v+1;
> 
>       }
> 
> }
> 
> public static class IncreaseTwo{
> 
> public int increase(int v) {
> 
>           return v+2;
> 
> }
> 
> }
> 
> 
> 
> public static class SumAggregateBean implements AggregationStrategy{
> 
> public Exchange aggregate(Exchange oldExchange, Exchange newExchange) {
> 
>    if(oldExchange == null)
> 
>       return newExchange;
> 
>    int v = parseInt(newExchange.getIn().getBody()) + 
> 
>        parseInt(oldExchange.getIn().getBody());
> 
>    newExchange.getIn().setBody(v);
> 
>    return newExchange;
> 
> }
> 
> }
> 

Reply via email to