I wouldnt combine these steps (separation of concerns; readability of the
route), especially if #2 is a one liner:
from(...)
.setHeader("MyMessageHeader", xpath(...)) //1
.split(body()) // 2
.to(..whereToProcess..)
.aggregate(header("MyMessageHeader")) // 3
#1: Setting the header before splitting them has the advantage that all
split messages should have that common header.
(please test ;)
#2:
https://camel.apache.org/splitter.html#Splitter-SplittingaCollection,Iterato
rorArray
#3: https://camel.apache.org/aggregator.html
Should also be possibly as strategyRef option on the splitter, but I
havent it found as fast as this ;)
Jan
> -----Ursprüngliche Nachricht-----
> Von: mattmadhavan [mailto:[email protected]]
> Gesendet: Mittwoch, 20. August 2014 23:52
> An: [email protected]
> Betreff: Camel Custom Splitter Question
>
> Hello,
> I want to able be able to write a custom splitter such that:
> 1) A message with collection is broken down into individual
> message(exchange)
> 2) Based on the content of the message add a Message header.
> 3) Aggregate the split messages using the message header as the
> strategy.
>
> The only way I see is to use a content enricher/processor to perform
> step 2). Is there a way to combine step 1) and 2)?
>
> Or if there is any other idea I am all for it.
>
> Can some one point me to the right direction please?
>
> Thanks in advance!
> Matt
>
>
>
>
>
> -----
> Thanks
> Matt G. Madhavan
> --
> View this message in context: http://camel.465427.n5.nabble.com/Camel-
> Custom-Splitter-Question-tp5755453.html
> Sent from the Camel - Users mailing list archive at Nabble.com.