Hi,

I'm not sure what you are asking about. You may provide some route code you already have.

The first route you will need is the polling of the file and decission what kind of file has been found (pdf, txt, xml)

Handle that files in different routes and bring them to the same format.

Send the normalized messages to one endpoint which aggregates them.

here is a minimal example (not tested, read it like pseudo code)


from("file:///user/dir1")
    .choice()
        .when(header("CamelFileNameOnly").contains(".pdf"))
            .to("direct:processPdfFile")
        .when(header("camelFileNameOnly").contains(".txt"))
            .to("direct:processTextFile")
        .when(header("camelFileNameOnly").contains(".xml"))
            .to("direct:processXmlFile");

// you need equivalent endpoints to transform txt and pdf files
from("direct:processXmlFile")
    .bean(XmlTransformerBean.class, "transformXml")
    .to("direct:aggregateMesssages");

from("direct:aggregateMesssages")
    // have a look here: http://camel.apache.org/aggregator2.html
    .aggregate(new MyXmlAggregatingStrategy()).completionSize(3))
    .to("direct:doSomethingWithTheAggregatedMessage");


regards, Marco

Am 22.04.2013 11:43, schrieb Nibha Kumari:
Hi,

I am pretty new to camel. I am using camel 2.4.

I want to aggregate different file format (.pdf,.xml..txt) from same source
(user/dir1) and
then I need to process .xml file what i got after aggregation
and then move all the files into a different directory.

The problem i am facing is I dont know how I get my files after aggregation
for further processing.

if I will use groupExchange=true, then how will I get my files. how should i
split that aggregated Exchange .

Pleases give some suggestions or information.

Thanks in advance.






--
View this message in context: 
http://camel.465427.n5.nabble.com/Aggregator-and-splitter-tp5731227.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Reply via email to