Hi,
I'm new to Apache Camel.
I'm trying to use  Camel to convert some records from a db table to a csv 
file.

After csv file creation, with another route, I will send it by beans sftp 
camel component.

The route user is:  

          from("jpa:com.italtel.esc.db.synchro.ClientTableEntity?
consumeDelete=true&maximumResults=1000&maxMessagesPerPoll=5000&delay=120000&consumeLockEntity=false")
          .process( new ClientTableToCSVProcessor())
          .to("file://d:/test?fileExist=Append&fileName=report-${header.
DateHourMinute}.csv");

Field ${header.DateHourMinute} will contain date hour minute of operation, so 
I have different files for every polling.

With this route 
        from("file://d:/test").to("sftp://192.168.56.101/orders?
username=myuser&password=mypass");

I send csv files.

My question is: I can I discover that first route has finished the polling ? I 
tried with 1000 records and I saw the csv files is created at the first 
message/record. In this way, the second 
route will send a 'partial' file.
I also tried with doneFileName parameter, but also in this way doneFile is 
created at the first record.

I tried also with notification, but I didn't find an event that signal the end 
of polling.

Ho can I synchronize the routes ?

Thanks.

  

Reply via email to