Return-Path: Delivered-To: apmail-camel-users-archive@www.apache.org Received: (qmail 19809 invoked from network); 30 Jun 2010 03:18:18 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 30 Jun 2010 03:18:18 -0000 Received: (qmail 59451 invoked by uid 500); 30 Jun 2010 03:18:18 -0000 Delivered-To: apmail-camel-users-archive@camel.apache.org Received: (qmail 59177 invoked by uid 500); 30 Jun 2010 03:18:15 -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 59169 invoked by uid 99); 30 Jun 2010 03:18:14 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 30 Jun 2010 03:18:14 +0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests=FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of willem.jiang@gmail.com designates 74.125.83.173 as permitted sender) Received: from [74.125.83.173] (HELO mail-pv0-f173.google.com) (74.125.83.173) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 30 Jun 2010 03:18:07 +0000 Received: by pva18 with SMTP id 18so152425pva.32 for ; Tue, 29 Jun 2010 20:17:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:subject:references:in-reply-to :content-type:content-transfer-encoding; bh=EQGb72RK7MXeXGdlLh1kmxQivLvurz8eEOcd8gWMK8s=; b=jielPD+S46uts/UAxvIzRcBfL6z/yAotXqfgUSDUUBTJ3hlw6YhxtiixkKdnNZOLyM B4II/ROeO4mVYlQxstq9NjA27bM5YfnClmdZlcSbUkkahyiMeO58qqSXLyIZTbHp6j1P 7JcuQTdssvaL6cIxk08bDGM2oXtuRNifqTEK0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; b=cQc8DufbrUo8Xb1rnRX7+CbXM7SL7JycnR8E8NVAf6JyDzpjIIl5SUly6eBCeiEn2J 8cfGOm3d3GxQ7ZINGR4kaUqdfYHIqJWbQU1eXChE7Sg95IH7ynTqTYomyMCTa8V3JBsS PaLq9QNPWsR6gknyBIvPLoBsxPRm7VeX1kyjo= Received: by 10.143.24.32 with SMTP id b32mr7647744wfj.219.1277867865302; Tue, 29 Jun 2010 20:17:45 -0700 (PDT) Received: from [192.168.0.158] ([125.34.9.192]) by mx.google.com with ESMTPS id f2sm5465051wfp.11.2010.06.29.20.17.43 (version=TLSv1/SSLv3 cipher=RC4-MD5); Tue, 29 Jun 2010 20:17:44 -0700 (PDT) Message-ID: <4C2AB754.7060207@gmail.com> Date: Wed, 30 Jun 2010 11:17:40 +0800 From: Willem Jiang User-Agent: Thunderbird 2.0.0.24 (Macintosh/20100228) MIME-Version: 1.0 To: users@camel.apache.org Subject: Re: Camel 2.3.0 - File Endpoint with delete=true and moveFailed doesn't move failed files References: <1277855193825-511964.post@n5.nabble.com> In-Reply-To: <1277855193825-511964.post@n5.nabble.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org Hi, I just checked the code of Camel File component, you can't specify the delete and move (moveFailed) option at the same time, as current Camel file component didn't support these two strategy at same time. I think you can do some work around by using onException() with the delete option, like this : onException(IllegalArgumentException.class).useOriginalMessage().to("file://target/failed/error"); from("file://target/failed?delete=true") .... Willem ---------------------------------- Apache Camel, Apache CXF committer Open SOA http://www.fusesource.com Blog http://willemjiang.blogspot.com Tiwtter http://twitter.com/willemjiang jonathanq wrote: > I am using Camel 2.3.0 - I have a file endpoint that is configured with > delete=true and moveFailed=error. Yet when an error occurs, it does not > move it to a failed directory, and instead keeps re-trying the exchange. > > Here is a route that shows my setup: > > public void configure() throws Exception { > > onException().process(myErrorProcessor).to("mock:error"); > > from("file://c:\\input?delete=true&moveFailed=error").process(someProcessor).unmarshal().xstream().to("mock:result") > > } > > The processor just does a simple transformation - however I am feeding it > invalid XML so that the unmarshal will fail. The error processor is > executed, but when it completes and sends its error message to "mock:error" > - the whole route starts again. > > I removed the "delete=true" so it was just: > "file://c:\\input?moveFailed=error". Then when an error occurs, it moves > the file to error subdirectory. And the completed files go to ".camel". > > I don't want to have to remove the completed files manually so I changed the > route to: > > "file://c:\\input?delete=true" > Now - regardless of whether an exception occurs - the input file is deleted. > > It seems to be that the combination of both "delete=true" and > "moveFailed=error" seems to cause the route to keep re-trying indefinately, > but on their own - they work exactly as advertised. > > Is the delete=true supposed to only moved completed (successfully) files? > The documentation only says it will delete them after they are processed > (doesn't say if they succeeded or not). > > I added a handled(true) on my exception route - and then it just deletes the > file and never moves it to the error folder. > > I can remove the delete=true and my process will do what I want - however > then I have to make a manual step later to delete the contents of the .camel > folder for the ones that did work. And I don't want to do that, seems to me > the delete=true should handle that. > > Jonathan