Re: Using ConsumerTemplate to fetch files.

2017-04-04 Thread dilip.pashupathi
Hi, I was working with something similar to this problem. But I am not able to capture the exceptions properly. Setps: 1. Download the existing file from the FTP 2. Push the file to backup folder and append the file name with current date 3. Push a new file to the FTP which has a complete new fi

Re: Using ConsumerTemplate to fetch files.

2017-04-03 Thread Zoran Regvart
Hi Dilip, doesn't a single ftp route with fileExist=Move fulfil your requirements? You mention that you use direct routes so starting from a direct route with body set to payload of the new file to be uploaded to the FTP server and CamelFileName header set to the file name: from("direct:uploa

Re: Using ConsumerTemplate to fetch files.

2017-04-03 Thread dilip.pashupathi
Hi, Basic idea here is to capture any exception that may occur due to failure in FTP connections or any other form of exception. Since the process is happening inside the contentBackupProcessor, Camel is basically ignoring the exception and continuing with the next operation as if nothing wrong h

Re: Using ConsumerTemplate to fetch files.

2017-04-02 Thread dilip.pashupathi
Hi, I also tried your suggestions like below from("ftp://username@localhost:8899/...") .mulitcast().to("direct:processes-backup","direct:upload-fresh"); from("direct:process-backup") .bean(responseTranslator,"translate"). But when I started my jetty server where the service is deploy

Re: Using ConsumerTemplate to fetch files.

2017-04-02 Thread dilip.pashupathi
Hi, Thanks for the reply, The thing is we don't have multiple FTP servers. We have only one server where all operations happens. 1. At the root folder of the FTP, there is file that needs to be deleted 2. Before deleting that file, the file should be taken as a backup and placed in one of the sub

Re: Using ConsumerTemplate to fetch files.

2017-03-31 Thread Zoran Regvart
Hi Dilip, this to me seems to be an overly complicated solution to a simple problem. If I understand your problem correctly: you gather a file from ftp server1 and push to two different ftp servers, serverA and serverB, the serverA gets the transformed file and serverB gets the original file (backu

Re: Using ConsumerTemplate to fetch files.

2017-03-31 Thread dilip.pashupathi
Hi, I was working with something similar to this problem. But I am not able to capture the exceptions properly. Setps: 1. Download the existing file from the FTP 2. Push the file to backup folder and append the file name with current date 3. Push a new file to the FTP which has a complete new

Re: Using ConsumerTemplate to fetch files.

2010-12-16 Thread Claus Ibsen
On Thu, Dec 16, 2010 at 9:28 AM, Andreas A. wrote: > > If I use receiveNoWait() no files will be downloaded from the ftp, maybe > because the the ftp component doesn't have time to login to the ftp? > -- Ah yeah that is correct, there is no wait :) That works better if you poll messages from a qu

Re: Using ConsumerTemplate to fetch files.

2010-12-16 Thread Andreas A.
If I use receiveNoWait() no files will be downloaded from the ftp, maybe because the the ftp component doesn't have time to login to the ftp? -- View this message in context: http://camel.465427.n5.nabble.com/Using-ConsumerTemplate-to-fetch-files-tp3304671p3307566.html Sent from the Camel - User

Re: Using ConsumerTemplate to fetch files.

2010-12-14 Thread Claus Ibsen
Its probably best to receive without any timeout, using receiveNoWait. On Tue, Dec 14, 2010 at 6:43 PM, Andreas A. wrote: > > Hi > > Something fishy is still going on, this is the code now: > > String ftpsUri = > "ftp:localhost:1981/inbox?consumer.delay=1h&username=camel&password=camel123&move=.

Re: Using ConsumerTemplate to fetch files.

2010-12-14 Thread Andreas A.
Hi Something fishy is still going on, this is the code now: String ftpsUri = "ftp:localhost:1981/inbox?consumer.delay=1h&username=camel&password=camel123&move=.done"; String fileUri = "file:{{path.in}}"; consumer.start(); while(true) { Exchange exchange = consumer.receive(ftpsUri, 5000

Re: Using ConsumerTemplate to fetch files.

2010-12-14 Thread Claus Ibsen
I have created a ticket to make this easier using the ConsumerTemplate API https://issues.apache.org/jira/browse/CAMEL-3427 Check the source code in trunk, how to do it in your Camel version. On Tue, Dec 14, 2010 at 4:39 PM, Andreas A. wrote: > > Can't find anything along those lines. I tried d

Re: Using ConsumerTemplate to fetch files.

2010-12-14 Thread Andreas A.
Oh it was a private method. Thought you meant in the api. I suppose I should do the manual handover then. Just pasting here for future reference: if (exchange.getUnitOfWork() == null) { // handover completions and done them manually to ensure they are being executed List synchroni

Re: Using ConsumerTemplate to fetch files.

2010-12-14 Thread Andreas A.
Can't find anything along those lines. I tried doing while(true) { Exchange ex = consumer.receive(ftpsUri, 5000); if(ex != null) { logger.info("Fetching file: " + ex.getIn().getHeader("CamelFileName")); producer.send(fileUri, ex);

Re: Using ConsumerTemplate to fetch files.

2010-12-14 Thread Claus Ibsen
On Tue, Dec 14, 2010 at 4:27 PM, Andreas A. wrote: > > However if I use only receiveBody I miss the headers like the filename etc. > -- Then you need to done the Exchange yourself. See the doneUoW method in DefaultConsumerTemplate > View this message in context: > http://camel.465427.n5.nabble.

Re: Using ConsumerTemplate to fetch files.

2010-12-14 Thread Andreas A.
However if I use only receiveBody I miss the headers like the filename etc. -- View this message in context: http://camel.465427.n5.nabble.com/Using-ConsumerTemplate-to-fetch-files-tp3304671p3304747.html Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Using ConsumerTemplate to fetch files.

2010-12-14 Thread Andreas A.
Ah ok! -- View this message in context: http://camel.465427.n5.nabble.com/Using-ConsumerTemplate-to-fetch-files-tp3304671p3304746.html Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Using ConsumerTemplate to fetch files.

2010-12-14 Thread Andreas A.
Hi I should be a subscriber. I have made 100+ posts via nabble. I haven't changed anything regarding my account, are my posts not accepted on the mailinglist anymore or? I've tried with both 2.5 and 2.6. I'm getting some really odd behaviour - why is it stacking the base dir "inbox"?: -> ERROR

Re: Using ConsumerTemplate to fetch files.

2010-12-14 Thread davsclaus
Since you work with the low level Exchange, you need to done it if you want it to move the files. exchange.getUnitOfWork().done(exchange); This is done automatic for you in Camel 2.5 onwards if you use, eg receiveBody instead Object body = consumer.redeveiveBody("uri", xxx); -- View this messag

Re: Using ConsumerTemplate to fetch files.

2010-12-14 Thread davsclaus
Are you a subscriber of the mailing list? I haven't seen you mail before. You need Camel 2.5 or better AFAIR for the consumer template to work with files, where it supports deleting / moving files when done. -- View this message in context: http://camel.465427.n5.nabble.com/Using-ConsumerTempla