camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From snowbug <laji.in...@gmail.com>
Subject Re: Split / aggregate using custom beans
Date Wed, 02 Sep 2009 04:42:10 GMT

It's not eclipse IDE as the error exists when I try to compile use Ant.

I'm using Camel 2.0.0, and the following line does not compile:
        from("direct:start")
            .split().method("bean", "method")
                .to("direct:next")
             .aggregate().method("bean", "method")
             .to("");
The last ".to()" is having compilation error because the compile thinks the
returned object from .aggregate().method("bean", "method") is of type
Object.

Is my syntax wrong? 

Thanks,

Alan



snowbug wrote:
> 
> It looks like probably is the eclipse IDE problem as it is not able to
> resolve the split() but not the following aggregate() I put there. It
> seems that the generic type "T" in these two methods are sometimes not
> picked up by eclipse. 
> 
> It might be just my IDE's isolated case, if others is not experiencing the
> same.
> 
> Alan
> 
> 
> willem.jiang wrote:
>> 
>> Which version of Camel are you using?
>> Here is unit test[1] for the split() with the method() DSL in Camel 2.x 
>> trunk.
>> 
>>> 
>>> 
>>> There is no split method that takes bean method parameter and an
>>> aggregator,
>>> it seems that I must implement the Expression interface in mySplitter
>>> class
>>> in order to use the split(Expression, AggreationStrategy) method.
>>> 
>>> So what is the correct way of using split and aggregate with custom
>>> beans?
>> You can write a DSL like this
>> .split(new MethodCallExpression("mybean", "mymethod") ,new 
>> MyOrderStrategy())
>> 
>>> 
>>> Thanks,
>>> 
>>> 
>> [1] 
>> https://svn.apache.org/repos/asf/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/SplitterMethodCallTest.java
>> 
>> Willem
>> 
>> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Split---aggregate-using-custom-beans-tp25247219p25251573.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Mime
View raw message