camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mark Doyle <>
Subject Re: Splitting a POJO message into multiple messages containing values of a collection from a stored as a field on the POJO.
Date Mon, 08 Oct 2012 12:28:49 GMT
Hi Claus,

Nothing so complex actually. I simply want to call a method on the POJO's
map field.

Here's the full example:

I have a POJO arriving in a message body. The POJO has a Map field, let's
say someMap. I want to split the message into multiple messages, one for
each value in the map. I don't care about the keys.

Something like this (pseudo)

I created a simple utility/helper class that takes the POJO and returns the
List of values which I can route through using camel:method. e.g:
    <camel:method ref="myClassExtractor" method="extractValues"/>
    <to uri="seda:parametersOut"/>

But I wondered if there was a one-step method, completely in configuration.

On 8 October 2012 10:00, Claus Ibsen <> wrote:

> On Sun, Oct 7, 2012 at 5:09 PM, Mark Doyle <>
> wrote:
> > Hi all,
> >
> > I there a simple way of taking a POJO from a message body and calling a
> > method on one of it's fields, e.g someMap.values() to return messages for
> > each element in a collection. I want to do this for a splitter.
> >
> > I can do it with various other methods, beans, processors, transformers
> etc
> > but it all seems a bit long winded.
> You want to invoke a method on each value from a map? And should you
> do something with their responses (eg if they are not void methods)?
> You can use an dynamic language like groovy, it should have extensions
> to collections to do this.
> --
> Claus Ibsen
> -----------------
> Red Hat, Inc.
> FuseSource is now part of Red Hat
> Email:
> Web:
> Twitter: davsclaus
> Blog:
> Author of Camel in Action:

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message