camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Claus Ibsen <>
Subject Re: A simple Aggregator use case
Date Thu, 21 Nov 2013 19:22:44 GMT
You can write a POJO with a method that extracts the prefix. And use
the method on the POJO as the correlation expression.

Though if you do not want to write java code, you may try your luck
with a regular expression and use the simple language with the regexp.

Or try any of the other scripting languages, which is more powerful

If you know the prefix is always the first 4 chars, you can call sub
string on a String.

<simple>${body.toString().substring(0, 3)}</simple>

On Thu, Nov 21, 2013 at 4:06 PM, ChrisS <> wrote:
> A simplified problem would be: How to aggregate messages with the same
> prefix?
> I could simply pass strings such as 0001:52, 0001:11, 0002:44. Is there a
> way to take a substring of the stream:in and use it as the header
> (correlationExpression)?
> Many thanks,
> CS
> --
> View this message in context:
> Sent from the Camel - Users mailing list archive at

Claus Ibsen
Red Hat, Inc.
Twitter: davsclaus
Author of Camel in Action:

View raw message