Currently, an expression and strategy are required (or you get a DSL
compilation error). Your best bet is to simply use the "constant(true)"
expression to match all exchanges and the groupExchanges() strategy to
simply store them all in an exchange property...
from()
.aggregate(constant(true))
.completionTimeout(500) //or completionInterval, completionSize,
etc...
.groupExchanges()
.process(...)
Then in your processor, just pull the exchanges from the exchange like
this...
List grouped = exchange.getProperty(Exchange.GROUPED_EXCHANGE, List.class);
That being said, it would be nice if this just was the default behavior...
pminearo wrote:
>
> When using aggregate(), is there a default behavior?
> ...
> 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?
>
-----
Ben O'Day
IT Consultant -http://benoday.blogspot.com
--
View this message in context:
http://camel.465427.n5.nabble.com/Default-Behavior-for-aggregate-tp4296790p4297064.html
Sent from the Camel - Users mailing list archive at Nabble.com.