Return-Path: X-Original-To: apmail-camel-users-archive@www.apache.org Delivered-To: apmail-camel-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 864AB1058E for ; Thu, 31 Oct 2013 10:15:54 +0000 (UTC) Received: (qmail 53790 invoked by uid 500); 31 Oct 2013 10:15:53 -0000 Delivered-To: apmail-camel-users-archive@camel.apache.org Received: (qmail 53677 invoked by uid 500); 31 Oct 2013 10:15:52 -0000 Mailing-List: contact users-help@camel.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@camel.apache.org Delivered-To: mailing list users@camel.apache.org Received: (qmail 53667 invoked by uid 99); 31 Oct 2013 10:15:51 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 31 Oct 2013 10:15:51 +0000 X-ASF-Spam-Status: No, hits=1.3 required=5.0 tests=SPF_PASS,URI_HEX X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: local policy includes SPF record at spf.trusted-forwarder.org) Received: from [216.139.236.26] (HELO sam.nabble.com) (216.139.236.26) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 31 Oct 2013 10:15:45 +0000 Received: from [192.168.236.26] (helo=sam.nabble.com) by sam.nabble.com with esmtp (Exim 4.72) (envelope-from ) id 1VbpHf-000859-TF for users@camel.apache.org; Thu, 31 Oct 2013 03:15:23 -0700 Date: Thu, 31 Oct 2013 03:15:23 -0700 (PDT) From: BAnanth To: users@camel.apache.org Message-ID: <1383214523900-5742443.post@n5.nabble.com> Subject: Camel-FTP - retrieving the files tranferred and updating DB MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org Hi, I have the following requirement a. I have to transfer a file between two FTP servers. The URI's are dynamically created. (This has been done) b. Upon the successful transfer, I need to update the database with all the files that have been succesfully transferred. b.1 The DB table has the following structure id,filename, fromLocation,transferStatus,toLocation,timestamp c. Upon Exception the same has to be captured in the database. (transferStatus column to be updated) The snippet of the 'configure' method of the 'RouteBuilder' class is displayed below. (from, to etc are the parameters passed and refer to the FTP from URI and to URI respectively) /public void configure() throws Exception { String successQry = FTPDAOHelper.createQueryToInsertRecordInFileHistory("hardcodedfileName-how to get", from, FTPConstants.FTP_SUCCESSFUL, to, channelId); String failedQry = FTPDAOHelper.createQueryToInsertRecordInFileHistory("hardcodedfileName-how to get", from, FTPConstants.FTP_FAILED, to, channelId); onCompletion().onCompleteOnly().log("Fully Complete").setBody().constant(successQry).to("jdbc:dataSource"); onCompletion().onFailureOnly().log("Failed").setBody().constant(failedQry).to("jdbc:dataSource"); from(from).to(to).setBody().constant(successQry).to("jdbc:dataSource"); }/ I am facing the following problems, a. The success qry and failure qry are always fixed. Even though I am generating a unique UUID for file history table,the query generated uopon the execution always inserts the same record again and again. b. What could be the alternate approach (other than onComplete()). c. How do I get the file names and other parameters of the file from the exchange? Thanks and Regards, Bhavani -- View this message in context: http://camel.465427.n5.nabble.com/Camel-FTP-retrieving-the-files-tranferred-and-updating-DB-tp5742443.html Sent from the Camel - Users mailing list archive at Nabble.com.