Hi Ah yeah you hit a corner case there. You can use the sendEmptyMessage option and then filter that in the route, then a disconnect is called. But we should do a disconnect anyway when 0 is polled. You are welcome to log a JIRA ticket
Btw which Camel version do you use? On Fri, Apr 17, 2015 at 12:45 PM, Nick Bryan <n...@unit3d.tv> wrote: > I'm playing around with the ftp component but have a problem with the > disconnect option. It's defined as follows > > .from("ftp://host:21/distribution?Username=user > &Password=pass > &fileName=file.dtd > &passiveMode=true > &delay=600s > &maximumReconnectAttempts=3 > &reconnectDelay=5000 > &useFixedDelay=false > &disconnect=true") > > This works fine until a poll returns 0 files at which point it doesn't > disconnect and the next poll then fails with > > Will try again at next poll. Caused by: > [org.apache.camel.component.file.GenericFileOperationFailedException - File > operation failed: Software caused connection abort: recv failed. Code: 250] > org.apache.camel.component.file.GenericFileOperationFailedException: File > operation failed: Software caused connection abort: recv failed. Code: 250 > at > org.apache.camel.component.file.remote.FtpOperations.getCurrentDirectory(FtpOperations.java:701) > at > org.apache.camel.component.file.remote.FtpConsumer.pollDirectory(FtpConsumer.java:48) > at > org.apache.camel.component.file.GenericFileConsumer.poll(GenericFileConsumer.java:119) > at > org.apache.camel.impl.ScheduledPollConsumer.doRun(ScheduledPollConsumer.java:174) > at > org.apache.camel.impl.ScheduledPollConsumer.run(ScheduledPollConsumer.java:101) > at > java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) > at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308) > at > java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180) > at > java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294) > at > java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) > at > java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) > at java.lang.Thread.run(Thread.java:745) > Caused by: java.net.SocketException: Software caused connection abort: recv > failed > > It never recovers and needs a restart. Although this appears to be a problem > with how disconnect is handled in the ftp component can someone give me > pointers on how to work round this. > > Many thanks > Nick > (camel newbie) -- Claus Ibsen ----------------- Red Hat, Inc. Email: cib...@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/