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 0CB1C104B7 for ; Fri, 20 Sep 2013 11:56:54 +0000 (UTC) Received: (qmail 64157 invoked by uid 500); 20 Sep 2013 11:56:24 -0000 Delivered-To: apmail-camel-users-archive@camel.apache.org Received: (qmail 64089 invoked by uid 500); 20 Sep 2013 11:56:18 -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 64061 invoked by uid 99); 20 Sep 2013 11:56:18 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 20 Sep 2013 11:56:18 +0000 X-ASF-Spam-Status: No, hits=2.3 required=5.0 tests=SPF_SOFTFAIL,URI_HEX X-Spam-Check-By: apache.org Received-SPF: softfail (athena.apache.org: transitioning domain of ai.desu@gmail.com does not designate 216.139.236.26 as permitted sender) Received: from [216.139.236.26] (HELO sam.nabble.com) (216.139.236.26) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 20 Sep 2013 11:56:13 +0000 Received: from [192.168.236.26] (helo=sam.nabble.com) by sam.nabble.com with esmtp (Exim 4.72) (envelope-from ) id 1VMzJR-00068b-72 for users@camel.apache.org; Fri, 20 Sep 2013 04:55:53 -0700 Date: Fri, 20 Sep 2013 04:55:53 -0700 (PDT) From: Aida To: users@camel.apache.org Message-ID: <1379678153211-5739870.post@n5.nabble.com> Subject: [ConsumerTemplate] CamelLocks deleted before file is completely processed MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org Hi, I'm using the consumer template for reading files, and I'm experiencing something that makes me think that I'm not using it correctly. What happens to me is: 1. I have a dir with multiple files 2. The consumer template reads one of those files, creating a camelLock fil= e for the file that is going to be processed 3. The consumer template reads another file (same route, different thread) and, since the camelLock of the previous file still exists, deletes it and creates the camelLock for the file that is going to be processed now (the previous file haven=C2=B4t ended its processing and haven=C2=B4t been "fini= shed" using the doneUnitOfWork) 4. The same for each file that is read (the camelLocks are removed and a WARNING appears in the log " Deleting orphaned lock file: .../.. .camelLock") I think that maybe this is because I'm creating a new consumerTemplate each time I have to read something (could it be?), because I have seen that it has a ConsumerCache. The problem is that I use some "rules" to use it (one of them creating the CT each time), because of some problems I have had in the past: - Don=C2=B4t use the disconnect option for FTPs (Nullpointer, at least in C= amel 2.9.0 that leaves threads alive, Camel post in [1]) - Create a new Consumer template each time I read a file (same reasons as previous sentence) and stop it after use - I synchronize the method that consumes an endpoint because otherwise, whe= n reading files in parallel instead of reading two files, the consumer reads one twice In case it can helps, I put my code here: =09ConsumerTemplate cTemplate =3D camelContext.createConsumerTemplate()= ; =09Exchange dataExchange =3D null; =09if(timeoutInMilis =3D=3D 0){ =09=09dataExchange =3D cTemplate.receiveNoWait(endpoint2Consume); =09} =09else{ =09=09dataExchange =3D cTemplate.receive(endpoint2Consume, timeoutInMil= is); =09} =09 try { =09=09=09cTemplate.stop(); =09=09} catch (Exception e) { =09=09=09log ... =09=09} =09=09 Thanks in advance=09=09 =09=09 Camel Version: 2.10.4=09=09 [1] http://camel.465427.n5.nabble.com/FTP-ConsumerTemplate-Threads-remaining-al= ive-td5548338.html#a5723551 -- View this message in context: http://camel.465427.n5.nabble.com/ConsumerTem= plate-CamelLocks-deleted-before-file-is-completely-processed-tp5739870.html Sent from the Camel - Users mailing list archive at Nabble.com.