You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Pallavi G S <ra...@gmail.com> on 2016/07/07 11:30:40 UTC

Camel file movement from one folder to another sometimes giving exception saying "Cannot rename file"

Below is the configured route :

<camel:endpoint id="srcFolder"
			uri="file://SRC?move=.Success&amp;moveFailed=.Error" />

<camel:endpoint id="destFolder"
			uri="file://DEST?move=.Success&amp;moveFailed=.Error" />

<camel:route>
	<camel:from uri="srcFolder" />
	<camel:threads maxPoolSize="12" threadName="tid" id="tid" poolSize="10">
		<camel:process ref="myProcessor" />
		<camel:to ref="destFolder" />
	</camel:threads>
</camel:route>

<bean id="myProcessor" class="com.abc.module.MyProcessor" />


Suppose there are 1000 files in the folder SRC,after the route is
executed,in the DEST folder i can see all the 1000 files.
But once the file is picked and processed,the files are moved to .Success.
After processing there will be few files missing in .Success/.Error folder.
There will be only 990 files moved to .Success but in DEST folder there will
be 1000 files.

Getting below exception for the missing files in .Success folder:

2016-07-07 16:10:47 GenericFileOnCompletion [WARN] Error during commit.
Exchange[org.apache.camel.component.file.GenericFileMessage@5f49bffc].
Caused by:
[org.apache.camel.component.file.GenericFileOperationFailedException -
Cannot rename file: GenericFile[/SRC/file1.zip] to:
GenericFile[/SRC/.Success/file1.zip]]
org.apache.camel.component.file.GenericFileOperationFailedException: Cannot
rename file: GenericFile[/SRC/file1.zip] to:
GenericFile[/SRC/.Success/file1.zip]
        at
org.apache.camel.component.file.strategy.GenericFileProcessStrategySupport.renameFile(GenericFileProcessStrategySupport.java:115)
        at
org.apache.camel.component.file.strategy.GenericFileRenameProcessStrategy.commit(GenericFileRenameProcessStrategy.java:88)
        at
org.apache.camel.component.file.GenericFileOnCompletion.processStrategyCommit(GenericFileOnCompletion.java:144)
        at
org.apache.camel.component.file.GenericFileOnCompletion.onCompletion(GenericFileOnCompletion.java:80)
        at
org.apache.camel.component.file.GenericFileOnCompletion.onComplete(GenericFileOnCompletion.java:54)
        at
org.apache.camel.util.UnitOfWorkHelper.doneSynchronizations(UnitOfWorkHelper.java:106)
        at
org.apache.camel.impl.DefaultUnitOfWork.done(DefaultUnitOfWork.java:226)
        at
org.apache.camel.util.UnitOfWorkHelper.doneUow(UnitOfWorkHelper.java:67)
        at
org.apache.camel.processor.CamelInternalProcessor$UnitOfWorkProcessorAdvice.after(CamelInternalProcessor.java:613)
        at
org.apache.camel.processor.CamelInternalProcessor$UnitOfWorkProcessorAdvice.after(CamelInternalProcessor.java:581)
        at
org.apache.camel.processor.CamelInternalProcessor$InternalCallback.done(CamelInternalProcessor.java:240)
        at
org.apache.camel.processor.CamelInternalProcessor$InternalCallback.done(CamelInternalProcessor.java:251)
        at
org.apache.camel.processor.RedeliveryErrorHandler$1.done(RedeliveryErrorHandler.java:410)
        at
org.apache.camel.management.InstrumentationProcessor$1.done(InstrumentationProcessor.java:81)
        at org.apache.camel.processor.Pipeline$1.done(Pipeline.java:145)
        at
org.apache.camel.processor.ThreadsProcessor$ProcessCall.run(ThreadsProcessor.java:83)
        at
java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
        at java.util.concurrent.FutureTask.run(FutureTask.java:262)
        at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)



--
View this message in context: http://camel.465427.n5.nabble.com/Camel-file-movement-from-one-folder-to-another-sometimes-giving-exception-saying-Cannot-rename-file-tp5784924.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Camel file movement from one folder to another sometimes giving exception saying "Cannot rename file"

Posted by vgaur <vi...@gmail.com>.
Hi,
I am not sure what are you trying to do but your destination Folder should
not contain move and move failed option .

At the same time change move to premove to avoid conflict.

/<camel:endpoint id="srcFolder" 
                       
uri="file://SRC?premove=.Success&amp;moveFailed=.Error" />
<camel:endpoint id="destFolder" 
                        uri="file://DEST" />
/






--
View this message in context: http://camel.465427.n5.nabble.com/Camel-file-movement-from-one-folder-to-another-sometimes-giving-exception-saying-Cannot-rename-file-tp5784924p5784942.html
Sent from the Camel - Users mailing list archive at Nabble.com.