On Mon, Apr 11, 2011 at 10:14 PM, pminearo <[email protected]> wrote: > I didn't see anything posted on this (though I may have missed it). I am > using Camel 2.7.0. > > When using aggregate(), is there a default behavior? What I mean by this > is, let say you have the following Route in your RouteBUilder: > > > from("jms:queue:myQueue").aggregate().process(new > BatchSaveMessagesToDBProcessor()); > > > Would the default behavior of Camel be to just create a List of whatever > objects are in Exchange.getIn().getBody()? > > I noticed there are 4 different aggregate() methods: > > > aggregate() > aggregate(AggregationStrategy) > > aggregate(Expression) > aggregate(Expression, AggregationStrategy) > > Let's say all you want to do is batch up the messages coming in in order to > do a batch save to the DB; would you need to specify an AggregationStrategy > and/or Expression; or will Camel handle creating a List of what is in the > "In" message body? > > What I have noticed is aggregate() and aggregate(AggregationStrategy) have a > different API than aggregate(Expression) and aggregate(Expression, > AggregationStrategy). Why the difference? >
There are methods on AggregationDefintion you use the continue configure the EIP. Its part of the DSL. See its documentation at http://camel.apache.org/aggregator2 For example using .completionPredicate(predicate) etc. Also the pattern is extensively covered in the Camel in Action book in chapter 8. > Thanks! > > -- > View this message in context: > http://camel.465427.n5.nabble.com/Default-Behavior-for-aggregate-tp4296790p4296790.html > Sent from the Camel - Users mailing list archive at Nabble.com. > -- Claus Ibsen ----------------- FuseSource Email: [email protected] Web: http://fusesource.com CamelOne 2011: http://fusesource.com/camelone2011/ Twitter: davsclaus Blog: http://davsclaus.blogspot.com/ Author of Camel in Action: http://www.manning.com/ibsen/
