Return-Path: Delivered-To: apmail-camel-users-archive@www.apache.org Received: (qmail 30863 invoked from network); 28 May 2010 14:51:28 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 28 May 2010 14:51:28 -0000 Received: (qmail 74350 invoked by uid 500); 28 May 2010 14:51:28 -0000 Delivered-To: apmail-camel-users-archive@camel.apache.org Received: (qmail 74321 invoked by uid 500); 28 May 2010 14:51:28 -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 74313 invoked by uid 99); 28 May 2010 14:51:28 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 28 May 2010 14:51:28 +0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests=AWL,FREEMAIL_FROM,SPF_HELO_PASS,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of lists@nabble.com designates 216.139.236.158 as permitted sender) Received: from [216.139.236.158] (HELO kuber.nabble.com) (216.139.236.158) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 28 May 2010 14:51:23 +0000 Received: from isper.nabble.com ([192.168.236.156]) by kuber.nabble.com with esmtp (Exim 4.63) (envelope-from ) id 1OI0tq-0004Ic-K3 for users@camel.apache.org; Fri, 28 May 2010 07:51:02 -0700 Message-ID: <28707903.post@talk.nabble.com> Date: Fri, 28 May 2010 07:51:02 -0700 (PDT) From: ankelee To: users@camel.apache.org Subject: Problems shutting down route onCompletion MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Nabble-From: andreasasmuss@gmail.com Hi I'm trying to do a use case similar to the one on page 371 in Camel in Action. I need to start a route. Copy a batch of files from FTP, and then shut it down again. Pseudo Spring DSL: ${property.CamelBatchComplete} == true I check if the property set by BatchConsumers - CamelBatchComplete is true, and if it is the last Exchange of the batch I shut down the route. This doesn't work correctly, I get a SocketException because the route is shut down before it is done processing the files. On top of this it seems to only fail when there's only one file on the ftp directory. I expected that onCompletion first would be triggered when the entire route is completely done processing but it doesn't seem to be the case - is this a bug or am I doing it wrong? Debug output: 2010-05-28 16:36:21,274 INFO [Camel Thread 0 - ftp://localhost/inbox?move=done&password=camel123&username=camel] [FtpPollingRoute]: Fetching camel-core-2.2.0-fuse-01-00.jar 2010-05-28 16:36:21,290 INFO [Camel Thread 0 - ftp://localhost/inbox?move=done&password=camel123&username=camel] [FtpPollingRoute]: camel-core-2.2.0-fuse-01-00.jar copied 2010-05-28 16:36:21,290 INFO [Camel Thread 1 - OnCompletion] [FtpPollingRoute]: onComplete = false 2010-05-28 16:36:27,186 INFO [Camel Thread 0 - ftp://localhost/inbox?move=done&password=camel123&username=camel] [FtpPollingRoute]: Fetching eclipse-jee-galileo-SR2-win32.zip 2010-05-28 16:36:28,466 INFO [Camel Thread 0 - ftp://localhost/inbox?move=done&password=camel123&username=camel] [FtpPollingRoute]: eclipse-jee-galileo-SR2-win32.zip copied 2010-05-28 16:36:28,466 INFO [Camel Thread 2 - OnCompletion] [FtpPollingRoute]: onComplete = false 2010-05-28 16:36:31,305 INFO [Camel Thread 0 - ftp://localhost/inbox?move=done&password=camel123&username=camel] [FtpPollingRoute]: Fetching isuite-checkout.jar 2010-05-28 16:36:31,336 INFO [Camel Thread 0 - ftp://localhost/inbox?move=done&password=camel123&username=camel] [FtpPollingRoute]: isuite-checkout.jar copied 2010-05-28 16:36:31,336 INFO [Camel Thread 3 - OnCompletion] [FtpPollingRoute]: onComplete = true 2010-05-28 16:36:31,336 INFO [Camel Thread 3 - OnCompletion] [FtpPollingRoute]: Stopping 2010-05-28 16:36:31,352 INFO [Camel Thread 3 - OnCompletion] [FtpPollingRoute]: Stopped 2010-05-28 16:36:31,352 ERROR [Camel Thread 0 - ftp://localhost/inbox?move=done&password=camel123&username=camel] [org.apache.camel.component.file.GenericFileOnCompletion]: Caused by: [org.apache.camel.component.file.GenericFileOperationFailedException - File operation failed: Socket closed. Code: 221] org.apache.camel.component.file.GenericFileOperationFailedException: File operation failed: Socket closed. Code: 221 at org.apache.camel.component.file.remote.FtpOperations.buildDirectory(FtpOperations.java:228) at org.apache.camel.component.file.strategy.GenericFileRenameProcessStrategy.renameFile(GenericFileRenameProcessStrategy.java:85) at org.apache.camel.component.file.strategy.GenericFileRenameProcessStrategy.commit(GenericFileRenameProcessStrategy.java:72) at org.apache.camel.component.file.GenericFileOnCompletion.processStrategyCommit(GenericFileOnCompletion.java:121) at org.apache.camel.component.file.GenericFileOnCompletion.onCompletion(GenericFileOnCompletion.java:83) that wraps a SocketException: Caused by: java.net.SocketException: Socket closed at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:99) at java.net.SocketOutputStream.write(SocketOutputStream.java:136) at java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:65) at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:123) -- View this message in context: http://old.nabble.com/Problems-shutting-down-route-onCompletion-tp28707903p28707903.html Sent from the Camel - Users mailing list archive at Nabble.com.