What we do in this case is:

enrich("direct:step1", firstAggregationStrategy)
enrich("direct:step2", secondAggregationStrategy)
...

from("direct:step1")
  .convertBodyTo(Foo.class)
  .to("cxf:...");

from("direct:step2")
  .convertBodyTo(Bar.class)
  .to("cxf:...");

We implemented custom type converter [1] for the converter logic. But you
can also use (custom) data formats to transform from/to the types you
need...

[1] http://camel.apache.org/type-converter.html

Best,
Christian

On Wed, Mar 28, 2012 at 12:19 AM, GPRSLyons <gprsly...@gmail.com> wrote:

> Gents-
>
> As always, thanks for the help.
>
> In my route, it is very simple for me to convert the payload to JSON...
>
> .unmarshal().gzip()
> .unmarshal().json(JsonLibrary.Jackson, MyClass.class)
>
> However, I would like to enrich my content from multiple sources, such
> as...
>
> .loop(SOURCES.length)
> .enrich("source", new MyAggregationStrategy())
> .end
>
> Is there a way to apply that same conversion before the AggregationStrategy
> is called?  Working with byte arrays within the AggregationStrategy is
> becoming very complex.  I tried using the TypeConverter within the
> MyAggregationStrategy, but it is challenging to determine how to replicate
> the unmarshalling calls I make within the route in the same manner in the
> AggregationStrategy :(
>
> -Shan
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Enrichment-and-Type-Conversion-tp5599040p5599040.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>

Reply via email to