camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Claus Ibsen <claus.ib...@gmail.com>
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
http://camel.apache.org/languages

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 <cr019283@gmail.com> 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: http://camel.465427.n5.nabble.com/A-simple-Aggregator-use-case-tp5743633p5743634.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
Red Hat, Inc.
Email: cibsen@redhat.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen

Mime
View raw message