I resolved my problem by this way:

        this.from(m_from_folder_url)
                .split(new SplitExpression())
                .process(new Processor())
                .choice()
                    .when(header("type").isEqualTo("add"))
                        .to("direct:addEntry")
                    .when(header("type").isEqualTo("modify"))
                        .to("direct:modifyEntry");
        
        from("direct:addEntry").aggregate(header("add"), new
AggregationStrategy()).to(m_to_add_folder_url);
        from("direct:modifyEntry").aggregate(header("modify"), new
AggregationStrategy()).to(m_to_modify_folder_url);

so this is a route which:
 - reads a file
 - splits it's entities
 - processes each entry separately
 - according to their nature aggregating processed entries to the
appropriate file.



kodcanavari wrote:
> 
> Hi,
> 
> I want to use an aggregator in order to aggregate all messages comming.
> On my route i'm making a split with a splitter , then i process every
> messages  in parallel 
> and then i want to aggregate them all into a single file.
> 
> Here is my snippet :
> 
> 
> this.from(FROM_FOLDER).split(new LdapEntitySplitExpression()).process(new
> LdapModifyProcessor()).aggregate(header("LDIFRecord"),new
> LdapAggregationStrategy()).to(TO_FOLDER);
> 
> 
> and inside  LdapModifyProcessor() i do:
> 
> exchange.getOut().setHeader("type", "LDIFRecord");
> 
> but it does not work.
> 
> can anyone tellme how can i let every messages go thru aggregator?
> 
> regards.
> 
> 
> 
> 

-- 
View this message in context: 
http://old.nabble.com/How-to-aggregate-all-messages-into-a-single-message--tp25908234p26157808.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Reply via email to