Details
Description
I have used https://github.com/apache/camel-examples/tree/main/examples/artemis-large-messages using AMQ 7.8.0 Broker
Messages are getting processed but after processing the file is unable to delete from source location, tested in more than 1 windows systems facing the same
I am using Camel 3.14.3 and Spring boot 2.6.6 using JAVA DSL,
tested with Camel 3.18.1 and Spring boot 2.7.3 also
when running with Camel XML routes are fine but we want to use Java DSL , Kindly help.
Raising the concern in Zulip chat earlier.
https://camel.zulipchat.com/#narrow/stream/257298-camel/topic/camel-file.20artemis.20large.20message.20example.20failing.20in.20windows tion-poc/inbox0] o.a.c.c.file.GenericFileOnCompletion : Error during commit. Exchange[7D4CFE29E3F7515-0000000000000003]. Caused by: [org.apache.camel.component.file.GenericFileOperationFailedException - Error renaming file from C:\opt\file-transfer-solution-poc\inbox0\test.xlsx to C:\opt\file-transfer-solution-poc\inbox0\.camel\test.xlsx]org.apache.camel.component.file.GenericFileOperationFailedException: Error renaming file from C:\opt\file-transfer-solution-poc\inbox0\test.xlsx to C:\opt\file-transfer-solution-poc\inbox0\.camel\test.xlsx
at org.apache.camel.component.file.FileOperations.renameFile(FileOperations.java:93) ~[camel-file-3.14.3.jar:3.14.3]
at org.apache.camel.component.file.strategy.GenericFileProcessStrategySupport.renameFile(GenericFileProcessStrategySupport.java:145) ~[camel-file-3.14.3.jar:3.14.3]
at org.apache.camel.component.file.strategy.GenericFileRenameProcessStrategy.commit(GenericFileRenameProcessStrategy.java:121) ~[camel-file-3.14.3.jar:3.14.3]
at org.apache.camel.component.file.GenericFileOnCompletion.processStrategyCommit(GenericFileOnCompletion.java:134) ~[camel-file-3.14.3.jar:3.14.3]
at org.apache.camel.component.file.GenericFileOnCompletion.onCompletion(GenericFileOnCompletion.java:86) ~[camel-file-3.14.3.jar:3.14.3]
at org.apache.camel.component.file.GenericFileOnCompletion.onComplete(GenericFileOnCompletion.java:60) ~[camel-file-3.14.3.jar:3.14.3]
at org.apache.camel.support.UnitOfWorkHelper.doneSynchronization(UnitOfWorkHelper.java:104) ~[camel-support-3.14.3.jar:3.14.3]
at org.apache.camel.support.UnitOfWorkHelper.doneSynchronizations(UnitOfWorkHelper.java:93) ~[camel-support-3.14.3.jar:3.14.3]
at org.apache.camel.impl.engine.DefaultUnitOfWork.done(DefaultUnitOfWork.java:238) ~[camel-base-engine-3.14.3.jar:3.14.3]
at org.apache.camel.support.UnitOfWorkHelper.doneUow(UnitOfWorkHelper.java:61) ~[camel-support-3.14.3.jar:3.14.3]
at org.apache.camel.impl.engine.CamelInternalProcessor$UnitOfWorkProcessorAdvice.after(CamelInternalProcessor.java:777) ~[camel-base-engine-3.14.3.jar:3.14.3]
at org.apache.camel.impl.engine.CamelInternalProcessor$UnitOfWorkProcessorAdvice.after(CamelInternalProcessor.java:712) ~[camel-base-engine-3.14.3.jar:3.14.3]
at org.apache.camel.impl.engine.CamelInternalProcessor$AsyncAfterTask.done(CamelInternalProcessor.java:263) ~[camel-base-engine-3.14.3.jar:3.14.3]
at org.apache.camel.AsyncCallback.run(AsyncCallback.java:44) ~[camel-api-3.14.3.jar:3.14.3]
at org.apache.camel.impl.engine.DefaultReactiveExecutor$Worker.schedule(DefaultReactiveExecutor.java:193) ~[camel-base-engine-3.14.3.jar:3.14.3]
at org.apache.camel.impl.engine.DefaultReactiveExecutor.scheduleMain(DefaultReactiveExecutor.java:64) ~[camel-base-engine-3.14.3.jar:3.14.3]
at org.apache.camel.processor.Pipeline.process(Pipeline.java:184) ~[camel-core-processor-3.14.3.jar:3.14.3]
at org.apache.camel.impl.engine.CamelInternalProcessor.process(CamelInternalProcessor.java:398) ~[camel-base-engine-3.14.3.jar:3.14.3]
at org.apache.camel.component.file.GenericFileConsumer.processExchange(GenericFileConsumer.java:492) ~[camel-file-3.14.3.jar:3.14.3]
at org.apache.camel.component.file.GenericFileConsumer.processBatch(GenericFileConsumer.java:245) ~[camel-file-3.14.3.jar:3.14.3]
at org.apache.camel.component.file.GenericFileConsumer.poll(GenericFileConsumer.java:206) ~[camel-file-3.14.3.jar:3.14.3]
at org.apache.camel.support.ScheduledPollConsumer.doRun(ScheduledPollConsumer.java:202) ~[camel-support-3.14.3.jar:3.14.3]
at org.apache.camel.support.ScheduledPollConsumer.run(ScheduledPollConsumer.java:116) ~[camel-support-3.14.3.jar:3.14.3]
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) ~[na:na]
at java.base/java.util.concurrent.FutureTask.runAndReset(FutureTask.java:305) ~[na:na]
at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:305) ~[na:na]
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) ~[na:na]
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) ~[na:na]
at java.base/java.lang.Thread.run(Thread.java:834) ~[na:na]
Caused by: java.io.IOException: Renaming file from 'C:\opt\file-transfer-solution-poc\inbox0\test.xlsx' to 'C:\opt\file-transfer-solution-poc\inbox0\.camel\test.xlsx'
failed: Cannot delete file 'C:\opt\file-transfer-solution-poc\inbox0\test.xlsx' after copy succeeded
at org.apache.camel.util.FileUtil.renameFileUsingCopy(FileUtil.java:464) ~[camel-util-3.14.3.jar:3.14.3]
at org.apache.camel.component.file.FileOperations.renameFile(FileOperations.java:88) ~[camel-file-3.14.3.jar:3.14.3]
... 28 common frames omitted</code>