camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Claus Ibsen <>
Subject Re: Iterate over multivalued header
Date Tue, 11 Oct 2011 13:50:10 GMT
On Mon, Oct 10, 2011 at 10:26 PM, David Karlsen <> wrote:
> Hi.
> I'd like to iterate over a header containing a list and doing a "to
> uri" for each value.
> Is this possible?
> The splitter seems to only support body values, and camel:loop seems
> to be count-oriented.

The splitter supports using a custom expression, so you can refer to a header.
The splitter will then try to iterate that, so if the header is a
List/Collection etc. then it can do that out of the box.
I also believe if its a String value, then it will iterate using comma

Alternative you can write your custom expression and use that, or use
a method call expression and return the list of values from the header
to split.

> I could of course loop and use an expression for the list length and
> access it by index - but maybe something cleaner and down to the point
> exists OOTB?
> --
> --
> David J. M. Karlsen -

Claus Ibsen
Twitter: davsclaus, fusenews
Author of Camel in Action:

View raw message