Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Info
titleAggregationStrategy changed in Camel 2.0

In Camel 2.0 the AggregationStrategy callback have been changed to also be invoked on the very first Exchange.

On the first invocation of the aggregate method the oldExchange parameter is null. The reason is that we have not aggregated anything yet.
So its only the newExchange that has a value. Usually you just return the newExchange in this situation. But you still have the power to decide what to do, for example you can do some alternation on the exchange or remove some headers. And a more common use case is for instance to count some values from the body payload. That could be to sum up a total amount etc.

Warning
titleBatchTimeout and CompletionPredicate

You cannot use both batchTimeout and completionPredicate to trigger a completion based on either on reaching its goal first. The batch timeout will always trigger first, at that given interval. If you want to use completion predicate it is advised to not configure a batch timeout.

Using the Fluent Builders

The following example shows how to aggregate messages so that only the latest message for a specific value of the cheese header are sent.

...