Best strategy for processing large CSV files in Apache Camel

后端 未结 3 790
一生所求
一生所求 2020-12-01 11:02

I\'d like to develop a route that polls a directory containing CSV files, and for every file it unmarshals each row using Bindy and queues it in activemq.

The probl

3条回答
  •  长情又很酷
    2020-12-01 11:38

    If you use the Splitter EIP then you can use streaming mode which means Camel will process the file on a row by row basis.

    from("file://data/inbox?noop=true&maxMessagesPerPoll=1&delay=5000")
      .split(body().tokenize("\n")).streaming()
        .unmarshal().bindy(BindyType.Csv, "com.ess.myapp.core")           
        .to("jms:rawTraffic");
    

提交回复
热议问题