You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by sakchakravarthi <aj...@gmail.com> on 2014/07/08 09:27:55 UTC

File is not moved to .camel folder once it is processed

Hi 
I have a file route configuration 

<camel:from uri="file://{{file.data}}?filter=#StatusCheck"/>

once file got processed it is not getting moved to .camel folder no other
file options are used.




--
View this message in context: http://camel.465427.n5.nabble.com/File-is-not-moved-to-camel-folder-once-it-is-processed-tp5753491.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: File is not moved to .camel folder once it is processed

Posted by carlo cancellieri <c....@proximainformatica.com>.
Note also that windows uses exclusive lock on files so be sure to close all
the editors and background processes which may prevent file writing ops.

Buffered reader close() call will close the the underlying readers
recursively.

Cheers
Carlo
Il 09/lug/2014 08:25 "sakchakravarthi" <aj...@gmail.com>
ha scritto:

> Hi I am using camel 2.13.0, java 1.7, windows os
> I am doing file read in filter as BufferedReader br = br = new
> BufferedReader(new FileReader(file.getAbsoluteFilePath())); and I am
> closing
> BufferedReader.
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/File-is-not-moved-to-camel-folder-once-it-is-processed-tp5753491p5753563.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>

Re: File is not moved to .camel folder once it is processed

Posted by Claus Ibsen <cl...@gmail.com>.
Hi

Not sure but you may need to close file reader too, although I would
assume buffered reader did that too. But give it a try. Also you can
try remove that code, and see if Camel can delete the file. Then you
would know its that code causing the problem or not.

On Wed, Jul 9, 2014 at 6:26 AM, sakchakravarthi
<aj...@gmail.com> wrote:
> Hi I am using camel 2.13.0, java 1.7, windows os
> I am doing file read in filter as BufferedReader br = br = new
> BufferedReader(new FileReader(file.getAbsoluteFilePath())); and I am closing
> BufferedReader.
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/File-is-not-moved-to-camel-folder-once-it-is-processed-tp5753491p5753563.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
Red Hat, Inc.
Email: cibsen@redhat.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen
hawtio: http://hawt.io/
fabric8: http://fabric8.io/

Re: File is not moved to .camel folder once it is processed

Posted by sakchakravarthi <aj...@gmail.com>.
Hi I am using camel 2.13.0, java 1.7, windows os
I am doing file read in filter as BufferedReader br = br = new
BufferedReader(new FileReader(file.getAbsoluteFilePath())); and I am closing
BufferedReader.



--
View this message in context: http://camel.465427.n5.nabble.com/File-is-not-moved-to-camel-folder-once-it-is-processed-tp5753491p5753563.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: File is not moved to .camel folder once it is processed

Posted by Claus Ibsen <cl...@gmail.com>.
Hi

What Camel version do you use? And what os do you use? windows linux
or something else?
And try a newer Camel release to see if its fixed.
And if you do any java code with input stream / file input stream etc
then make sure to close them.

On Tue, Jul 8, 2014 at 9:27 AM, sakchakravarthi
<aj...@gmail.com> wrote:
> Hi
> I have a file route configuration
>
> <camel:from uri="file://{{file.data}}?filter=#StatusCheck"/>
>
> once file got processed it is not getting moved to .camel folder no other
> file options are used.
>
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/File-is-not-moved-to-camel-folder-once-it-is-processed-tp5753491.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
Red Hat, Inc.
Email: cibsen@redhat.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen
hawtio: http://hawt.io/
fabric8: http://fabric8.io/

RE: File is not moved to .camel folder once it is processed

Posted by sakchakravarthi <aj...@gmail.com>.
I am using filter as mentioned bellow.
1) I have two kinds of files TypeA and TypeB
2) When I get TypeB I am returning true in filter
3) When I am getting TypeA then I have to check status of previous consumed
TypeA file in DB. If previous file of TypeA is processed completely then
current TypeA file should be processed so I am sending true.
4) If previously consumed TypeA file is not processed I am sending false. So
this goes in loop until previous consumed file is processed.

Now, TypeA file ABC.txt is conusmed and got true from filter so camelLock is
getting created and file was moved for processing mean while again same file
ABC coming to filtered to get process.

Please let me know if any further information is required.





--
View this message in context: http://camel.465427.n5.nabble.com/File-is-not-moved-to-camel-folder-once-it-is-processed-tp5753491p5753641.html
Sent from the Camel - Users mailing list archive at Nabble.com.

RE: File is not moved to .camel folder once it is processed

Posted by sakchakravarthi <aj...@gmail.com>.
Yes Ravi I am seeing .camelLock file. in filter accept method I commented my
code and just returning defaultly true. Still file was not getting deleted
and observed .camelLock. But if any exception raised after passing through
filter then file was getting deleted. also I observed .camelLock was created
after coming back from filter



--
View this message in context: http://camel.465427.n5.nabble.com/File-is-not-moved-to-camel-folder-once-it-is-processed-tp5753491p5753646.html
Sent from the Camel - Users mailing list archive at Nabble.com.

RE: File is not moved to .camel folder once it is processed

Posted by sakchakravarthi <aj...@gmail.com>.
Yes Ravi I am seeing .camelLock file. in filter accept method I commented my
code and just returning defaultly true. Still file was not getting deleted
and observed .camelLock. But if any exception raised after passing through
filter then file was getting deleted.



--
View this message in context: http://camel.465427.n5.nabble.com/File-is-not-moved-to-camel-folder-once-it-is-processed-tp5753491p5753645.html
Sent from the Camel - Users mailing list archive at Nabble.com.

RE: File is not moved to .camel folder once it is processed

Posted by Ra...@cognizant.com.
It seems your filter code is locking the file which is preventing camel from deleting the same.

Do you see any .camelLock file created in the directory ?

-Ravi

-----Original Message-----
From: sakchakravarthi [mailto:ajit.kalyan.chakravarthi@gmail.com]
Sent: Thursday, July 10, 2014 2:54 PM
To: users@camel.apache.org
Subject: RE: File is not moved to .camel folder once it is processed

Observed that file is not getting deleted only when i am using filter. Could any one please help me on this.




--
View this message in context: http://camel.465427.n5.nabble.com/File-is-not-moved-to-camel-folder-once-it-is-processed-tp5753491p5753640.html
Sent from the Camel - Users mailing list archive at Nabble.com.
This e-mail and any files transmitted with it are for the sole use of the intended recipient(s) and may contain confidential and privileged information. If you are not the intended recipient(s), please reply to the sender and destroy all copies of the original message. Any unauthorized review, use, disclosure, dissemination, forwarding, printing or copying of this email, and/or any action taken in reliance on the contents of this e-mail is strictly prohibited and may be unlawful. Where permitted by applicable law, this e-mail and other e-mail communications sent to and from Cognizant e-mail addresses may be monitored.

RE: File is not moved to .camel folder once it is processed

Posted by sakchakravarthi <aj...@gmail.com>.
Observed that file is not getting deleted only when i am using filter. Could
any one please help me on this. 




--
View this message in context: http://camel.465427.n5.nabble.com/File-is-not-moved-to-camel-folder-once-it-is-processed-tp5753491p5753640.html
Sent from the Camel - Users mailing list archive at Nabble.com.

RE: File is not moved to .camel folder once it is processed

Posted by sakchakravarthi <aj...@gmail.com>.
My route like below Ravi Godbole
<camel:route>
			<camel:from uri="file://{{file.data}}?filter=#StatusCheck"/>
			<camel:bean ref="checkResponse" method="process"/>
			<camel:to uri="seda:dataqueue"/>
</camel:route>



--
View this message in context: http://camel.465427.n5.nabble.com/File-is-not-moved-to-camel-folder-once-it-is-processed-tp5753491p5753600.html
Sent from the Camel - Users mailing list archive at Nabble.com.

RE: File is not moved to .camel folder once it is processed

Posted by Ra...@cognizant.com.
Can you share the complete route  please ?

-Ravi

-----Original Message-----
From: sakchakravarthi [mailto:ajit.kalyan.chakravarthi@gmail.com]
Sent: Tuesday, July 08, 2014 12:58 PM
To: users@camel.apache.org
Subject: File is not moved to .camel folder once it is processed

Hi
I have a file route configuration

<camel:from uri="file://{{file.data}}?filter=#StatusCheck"/>

once file got processed it is not getting moved to .camel folder no other file options are used.




--
View this message in context: http://camel.465427.n5.nabble.com/File-is-not-moved-to-camel-folder-once-it-is-processed-tp5753491.html
Sent from the Camel - Users mailing list archive at Nabble.com.
This e-mail and any files transmitted with it are for the sole use of the intended recipient(s) and may contain confidential and privileged information. If you are not the intended recipient(s), please reply to the sender and destroy all copies of the original message. Any unauthorized review, use, disclosure, dissemination, forwarding, printing or copying of this email, and/or any action taken in reliance on the contents of this e-mail is strictly prohibited and may be unlawful. Where permitted by applicable law, this e-mail and other e-mail communications sent to and from Cognizant e-mail addresses may be monitored.