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 C10F57227 for ; Fri, 2 Sep 2011 20:05:34 +0000 (UTC) Received: (qmail 83305 invoked by uid 500); 2 Sep 2011 20:05:34 -0000 Delivered-To: apmail-camel-users-archive@camel.apache.org Received: (qmail 83165 invoked by uid 500); 2 Sep 2011 20:05:33 -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 83133 invoked by uid 99); 2 Sep 2011 20:05:33 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 02 Sep 2011 20:05:33 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of ctalkobt@ctalkobt.net designates 209.85.210.173 as permitted sender) Received: from [209.85.210.173] (HELO mail-iy0-f173.google.com) (209.85.210.173) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 02 Sep 2011 20:05:26 +0000 Received: by iabz25 with SMTP id z25so5093918iab.32 for ; Fri, 02 Sep 2011 13:05:05 -0700 (PDT) MIME-Version: 1.0 Received: by 10.231.74.13 with SMTP id s13mr2530101ibj.78.1314992066801; Fri, 02 Sep 2011 12:34:26 -0700 (PDT) Received: by 10.231.143.204 with HTTP; Fri, 2 Sep 2011 12:34:26 -0700 (PDT) Date: Fri, 2 Sep 2011 15:34:26 -0400 Message-ID: Subject: Camel 2.2 Removal of Endpoint Files From: Craig Taylor To: users Content-Type: multipart/alternative; boundary=000e0cdf0a5406322304abfa7354 X-Virus-Checked: Checked by ClamAV on apache.org --000e0cdf0a5406322304abfa7354 Content-Type: text/plain; charset=ISO-8859-1 >From a file based endpoint (eg: file, ftp, sftp) uri I'm attempting to remove files via the following: public void removeFilesFromUri( ConsumerTemplate consumerTempl, CamelContext camlContext, String uri ) { uri = uri + "&delete=true"; consumerTempl.start(); Exchange exc = consumerTempl.receive(uri,10000); while( exc != null ) { System.err.println( "Deleting:" + exc.getIn().getHeader(Exchange.FILE_NAME) ); // Receive and toss... exc = consumerTempl.receive(uri,10000); } consumerTempl.stop(); camlContext.removeEndpoints(uri); } The files are not deleted. I am able to see the "Deleting: " println entries for the affected endpoint files. I had expected that the act of receiving an exchange would generate the deletion of them. Is there anything I need to do to indicate to camel that I'm finished with the exchange and it's safe for it to remove the file? In other posts I've seen references to : exc.getUnitOfWork().done(exc) however, in the code above getUnitOfWork() returns null. This is in Camel 2.2 btw (I know... I know... ) Thanks, -- ------------------------------------------- Craig Taylor ctalkobt@ctalkobt.net --000e0cdf0a5406322304abfa7354--