Hi I trying to trigger a archive of a file on a sftp server on demand.

Bascially a message is sent to a queue with a filename, that file is then
consumed and should be sent to an archive folder on the sftp server.

It appears that it will not work in case 2 but does work in case one.

I've setup a simpler example to show what i mean.

Case 1. ( delete and/move works)

from("sftp://[email protected]?move=.archive&knownHostsFile=c://known_host&password=pass&binary=true&fileName=myfile.txt";)
                .to("file://c://archive");

Case 2. ( delete or/move does not work)
from("file://temp")
        .process(new Processor() {
                public void process(final Exchange exchange) throws Exception {
                        
                ConsumerTemplate consumerTemplate = 
getContext().createConsumerTemplate();
                Exchange pollExchange =
consumerTemplate.receive("sftp://[email protected]?move=.archive&knownHostsFile=c://known_host&password=pass&binary=true&fileName=myfile.txt";);
                
                                
exchange.getOut().setBody(pollExchange.getIn().getBody());
                                exchange.getOut().setHeader(Exchange.FILE_NAME, 
"myfile.txt");
                        }
                })
                .to("file://c://archive");


The only workaround I've found is if I use premove=.archive

Thanks

-- 
View this message in context: 
http://camel.465427.n5.nabble.com/SFTP-trigger-consuming-of-a-file-wont-delete-or-move-file-tp3376663p3376663.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Reply via email to