Hi Anderson,

The reason the file is preserved in the /tmp/in directory is due to the fact
that since Camel version 1.5.0.x the default behavior is to set
consumer.exclusiveReadLock to true which preserves a copy of the file in the
input directory but bars it from consideration from processing after the
first attempt. 

If you wish to override it,  set the delete option to true as follows
         from("file://C:/tmp/in?delete=true").to("jms:queue:in");

This should take care of the issue.

Cheers,

Ashwin...


Anderson Nielson wrote:
> 
> I am trying to build a simple example transfering files from a folder to
> another one through a JMS queue.
> 
> The problem is that the incoming file is never deleted from the Inbox.
> Besides that the following exception is thrown:
> 
> 15:57:28,781 | WARN  | ompon...@12e8360 | FileConsumer
>     | amel.component.file.FileConsumer  237 | Error committing file
> strategy:
> org.apache.camel.component.file.strategy.renamefileprocessstrat...@f16070
> java.io.IOException: Can not rename file from: \tmp\in\cd0103a.txt to:
> \tmp\in\.camel\cd0103a.txt
>       at
> org.apache.camel.component.file.strategy.RenameFileProcessStrategy.renameFile(RenameFileProcessStrategy.java:105)
>       at
> org.apache.camel.component.file.strategy.RenameFileProcessStrategy.commit(RenameFileProcessStrategy.java:76)
>       at
> org.apache.camel.component.file.FileConsumer.processStrategyCommit(FileConsumer.java:235)
>       at
> org.apache.camel.component.file.FileConsumer$2.done(FileConsumer.java:169)
>       at
> org.apache.camel.processor.UnitOfWorkProcessor$1.done(UnitOfWorkProcessor.java:57)
>       at
> org.apache.camel.management.InstrumentationProcessor$1.done(InstrumentationProcessor.java:74)
>       at
> org.apache.camel.processor.DeadLetterChannel.process(DeadLetterChannel.java:201)
>       at
> org.apache.camel.processor.DeadLetterChannel.process(DeadLetterChannel.java:132)
>       at
> org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:68)
>       at
> org.apache.camel.processor.UnitOfWorkProcessor.process(UnitOfWorkProcessor.java:52)
>       at
> org.apache.camel.component.file.FileConsumer.pollFile(FileConsumer.java:154)
>       at
> org.apache.camel.component.file.FileConsumer.pollFileOrDirectory(FileConsumer.java:90)
>       at
> org.apache.camel.component.file.FileConsumer.pollFileOrDirectory(FileConsumer.java:100)
>       at
> org.apache.camel.component.file.FileConsumer.poll(FileConsumer.java:66)
>       at
> org.apache.camel.impl.ScheduledPollConsumer.run(ScheduledPollConsumer.java:66)
>       at
> java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
>       at
> java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:317)
>       at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:150)
>       at
> java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(ScheduledThreadPoolExecutor.java:98)
>       at
> java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodic(ScheduledThreadPoolExecutor.java:181)
>       at
> java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:205)
>       at
> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
>       at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
>       at java.lang.Thread.run(Thread.java:619)
> 15:57:28,781 | ERROR | ompon...@12e8360 | FileConsumer
>     | rg.apache.camel.processor.Logger  203 | Can not rename file
> from: \tmp\in\cd0103a.txt to: \tmp\in\.camel\cd0103a.txt
> java.io.IOException: Can not rename file from: \tmp\in\cd0103a.txt to:
> \tmp\in\.camel\cd0103a.txt
>       at
> org.apache.camel.component.file.strategy.RenameFileProcessStrategy.renameFile(RenameFileProcessStrategy.java:105)
>       at
> org.apache.camel.component.file.strategy.RenameFileProcessStrategy.commit(RenameFileProcessStrategy.java:76)
>       at
> org.apache.camel.component.file.FileConsumer.processStrategyCommit(FileConsumer.java:235)
>       at
> org.apache.camel.component.file.FileConsumer$2.done(FileConsumer.java:169)
>       at
> org.apache.camel.processor.UnitOfWorkProcessor$1.done(UnitOfWorkProcessor.java:57)
>       at
> org.apache.camel.management.InstrumentationProcessor$1.done(InstrumentationProcessor.java:74)
>       at
> org.apache.camel.processor.DeadLetterChannel.process(DeadLetterChannel.java:201)
>       at
> org.apache.camel.processor.DeadLetterChannel.process(DeadLetterChannel.java:132)
>       at
> org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:68)
>       at
> org.apache.camel.processor.UnitOfWorkProcessor.process(UnitOfWorkProcessor.java:52)
>       at
> org.apache.camel.component.file.FileConsumer.pollFile(FileConsumer.java:154)
>       at
> org.apache.camel.component.file.FileConsumer.pollFileOrDirectory(FileConsumer.java:90)
>       at
> org.apache.camel.component.file.FileConsumer.pollFileOrDirectory(FileConsumer.java:100)
>       at
> org.apache.camel.component.file.FileConsumer.poll(FileConsumer.java:66)
>       at
> org.apache.camel.impl.ScheduledPollConsumer.run(ScheduledPollConsumer.java:66)
>       at
> java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
>       at
> java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:317)
>       at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:150)
>       at
> java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(ScheduledThreadPoolExecutor.java:98)
>       at
> java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodic(ScheduledThreadPoolExecutor.java:181)
>       at
> java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:205)
>       at
> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
>       at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
>       at java.lang.Thread.run(Thread.java:619)
> 
> Does the file component wait for some response from the JMS component? If
> does, how to set it?
> Am I forgetting something about setting using JMS?
> 
>  
> 


-----
--- 
Ashwin Karpe, Principal Consultant, PS - Opensource Center of Competence 
Progress Software Corporation
14 Oak Park Drive
Bedford, MA 01730
--- 
+1-972-304-9084 (Office) 
+1-972-971-1700 (Mobile) 
---- 
Blog: http://opensourceknowledge.blogspot.com/


-- 
View this message in context: 
http://www.nabble.com/Cannot-transfer-file-between-folders-when-using-a-queue-%28JMS%29-tp21503867p21528947.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.

Reply via email to