Hi Oleg,
attached you will find my test case: ftp.inbound.test.zip
Please take account of the following customized parts:
- As I'm behind a somehow very special proxy I introduced a ProxyFtpSessionFactory - the code is a modified DefaultFtpSessionFactory
- As already mentioned I modified the xsd of spring-integration-ftp to allow auto-startup - same as you have done in INT-2103 added 'auto-startup' to FTP inbound adapter
- I'm using Ivy for dependency management - please find dependency descriptions included in the build folder
To reproduce the error please adapt test.resource/user.properties and point to a FTP server, define files to download.
Eventually you have to run FtpInboundReceiveSample.testFTPInboundReceiveMulti pleFiles() more than once - the error seems to depend on timing... It is very likely that you will get an Exception while downloading the third file:
Code:
09:53:15.830 [main] INFO o.s.i.e.SourcePollingChannelAdapter - started ftpInboundAdapter
09:53:16.033 [task-scheduler-2] DEBUG d.v.i.ftp.SingleFtpFileFilter - Accepted file yyyy_indices_20111128.csv
09:53:16.033 [task-scheduler-1] DEBUG d.v.i.ftp.SingleFtpFileFilter - Accepted file yyyy_indices_20111128.csv
09:53:16.236 [task-scheduler-2] INFO o.s.i.ftp.session.FtpSession - File have been successfully transfered to: abc/def/yyyy_indices_20111128.csv
09:53:16.236 [task-scheduler-1] INFO o.s.i.ftp.session.FtpSession - File have been successfully transfered to: abc/def/yyyy_indices_20111128.csv
09:53:16.236 [task-scheduler-1] DEBUG o.s.i.e.SourcePollingChannelAdapter - Poll resulted in Message: null
09:53:16.236 [task-scheduler-2] DEBUG o.s.i.file.FileReadingMessageSource - Added to queue: [C:\WINDOWS\Profiles\xxx\LOCALS~1\Temp\localtest\yyyy_indices_20111128.csv]
09:53:16.236 [task-scheduler-1] DEBUG o.s.i.e.SourcePollingChannelAdapter - Received no Message during the poll, returning 'false'
09:53:16.236 [task-scheduler-2] INFO o.s.i.file.FileReadingMessageSource - Created message: [[Payload=C:\WINDOWS\Profiles\xxxx\LOCALS~1\Temp\localtest\yyyy_indices_20111128.csv][Headers={timestamp=1323766396236, id=3f061130-36d0-4f16-b3ce-2cae60e2caf4}]]
09:53:16.236 [task-scheduler-2] DEBUG o.s.i.e.SourcePollingChannelAdapter - Poll resulted in Message: [Payload=C:\WINDOWS\Profiles\xxxx\LOCALS~1\Temp\localtest\yyyy_indices_20111128.csv][Headers={timestamp=1323766396236, id=3f061130-36d0-4f16-b3ce-2cae60e2caf4}]
09:53:16.236 [task-scheduler-2] DEBUG o.s.i.channel.DirectChannel - preSend on channel 'filterChannel', message: [Payload=C:\WINDOWS\Profiles\xxxx\LOCALS~1\Temp\localtest\yyyy_indices_20111128.csv][Headers={timestamp=1323766396236, id=3f061130-36d0-4f16-b3ce-2cae60e2caf4}]
09:53:16.236 [task-scheduler-2] DEBUG o.s.integration.filter.MessageFilter - org.springframework.integration.filter.MessageFilter@15e2075 received message: [Payload=C:\WINDOWS\Profiles\xxxx\LOCALS~1\Temp\localtest\yyyy_indices_20111128.csv][Headers={timestamp=1323766396236, id=3f061130-36d0-4f16-b3ce-2cae60e2caf4}]
09:53:16.236 [task-scheduler-2] DEBUG d.v.i.ftp.SingleFtpFileFilter - Accepted message {}[Payload=C:\WINDOWS\Profiles\xxxx\LOCALS~1\Temp\localtest\yyyy_indices_20111128.csv][Headers={timestamp=1323766396236, id=3f061130-36d0-4f16-b3ce-2cae60e2caf4}]
09:53:16.236 [task-scheduler-2] DEBUG o.s.integration.filter.MessageFilter - handler 'org.springframework.integration.filter.MessageFilter@15e2075' sending reply Message: [Payload=C:\WINDOWS\Profiles\xxxx\LOCALS~1\Temp\localtest\yyyy_indices_20111128.csv][Headers={timestamp=1323766396236, id=3f061130-36d0-4f16-b3ce-2cae60e2caf4}]
09:53:16.236 [task-scheduler-2] DEBUG o.s.integration.channel.QueueChannel - preSend on channel 'downloadChannel', message: [Payload=C:\WINDOWS\Profiles\xxxx\LOCALS~1\Temp\localtest\yyyy_indices_20111128.csv][Headers={timestamp=1323766396236, id=3f061130-36d0-4f16-b3ce-2cae60e2caf4}]
09:53:16.236 [task-scheduler-2] DEBUG o.s.integration.channel.QueueChannel - postSend (sent=false) on channel 'downloadChannel', message: [Payload=C:\WINDOWS\Profiles\xxxx\LOCALS~1\Temp\localtest\yyyy_indices_20111128.csv][Headers={timestamp=1323766396236, id=3f061130-36d0-4f16-b3ce-2cae60e2caf4}]
09:53:16.236 [task-scheduler-2] DEBUG o.s.i.c.PublishSubscribeChannel - preSend on channel 'errorChannel', message: [Payload=org.springframework.integration.MessageDeliveryException: failed to send message to channel 'downloadChannel' within timeout: -1][Headers={timestamp=1323766396236, id=2c59c498-a554-4c28-b51d-6800cc128a1e}]
09:53:16.236 [task-scheduler-2] DEBUG o.s.i.handler.LoggingHandler - (inner bean)#2 received message: [Payload=org.springframework.integration.MessageDeliveryException: failed to send message to channel 'downloadChannel' within timeout: -1][Headers={timestamp=1323766396236, id=2c59c498-a554-4c28-b51d-6800cc128a1e}]
09:53:16.236 [task-scheduler-2] ERROR o.s.i.handler.LoggingHandler - org.springframework.integration.MessageDeliveryException: failed to send message to channel 'downloadChannel' within timeout: -1
at org.springframework.integration.core.MessagingTemplate.doSend(MessagingTemplate.java:292)
at org.springframework.integration.core.MessagingTemplate.send(MessagingTemplate.java:149)
at org.springframework.integration.handler.AbstractReplyProducingMessageHandler.sendMessage(AbstractReplyProducingMessageHandler.java:176)
at org.springframework.integration.handler.AbstractReplyProducingMessageHandler.sendReplyMessage(AbstractReplyProducingMessageHandler.java:160)
at org.springframework.integration.handler.AbstractReplyProducingMessageHandler.produceReply(AbstractReplyProducingMessageHandler.java:125)
at org.springframework.integration.handler.AbstractReplyProducingMessageHandler.handleResult(AbstractReplyProducingMessageHandler.java:119)
at org.springframework.integration.handler.AbstractReplyProducingMessageHandler.handleMessageInternal(AbstractReplyProducingMessageHandler.java:101)
at org.springframework.integration.handler.AbstractMessageHandler.handleMessage(AbstractMessageHandler.java:78)
at org.springframework.integration.dispatcher.UnicastingDispatcher.doDispatch(UnicastingDispatcher.java:110)
at org.springframework.integration.dispatcher.UnicastingDispatcher.dispatch(UnicastingDispatcher.java:97)
at org.springframework.integration.channel.AbstractSubscribableChannel.doSend(AbstractSubscribableChannel.java:61)
at org.springframework.integration.channel.AbstractMessageChannel.send(AbstractMessageChannel.java:157)
at org.springframework.integration.channel.AbstractMessageChannel.send(AbstractMessageChannel.java:128)
at org.springframework.integration.core.MessagingTemplate.doSend(MessagingTemplate.java:288)
at org.springframework.integration.core.MessagingTemplate.send(MessagingTemplate.java:149)
at org.springframework.integration.endpoint.SourcePollingChannelAdapter.doPoll(SourcePollingChannelAdapter.java:102)
at org.springframework.integration.endpoint.AbstractPollingEndpoint$1.call(AbstractPollingEndpoint.java:146)
at org.springframework.integration.endpoint.AbstractPollingEndpoint$1.call(AbstractPollingEndpoint.java:144)
at org.springframework.integration.endpoint.AbstractPollingEndpoint$Poller$1.run(AbstractPollingEndpoint.java:207)
at org.springframework.integration.util.ErrorHandlingTaskExecutor$1.run(ErrorHandlingTaskExecutor.java:52)
at org.springframework.core.task.SyncTaskExecutor.execute(SyncTaskExecutor.java:48)
at org.springframework.integration.util.ErrorHandlingTaskExecutor.execute(ErrorHandlingTaskExecutor.java:49)
at org.springframework.integration.endpoint.AbstractPollingEndpoint$Poller.run(AbstractPollingEndpoint.java:202)
at org.springframework.scheduling.support.DelegatingErrorHandlingRunnable.run(DelegatingErrorHandlingRunnable.java:51)
at org.springframework.scheduling.concurrent.ReschedulingRunnable.run(ReschedulingRunnable.java:81)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:98)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:206)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)
09:53:16.236 [task-scheduler-2] DEBUG o.s.i.c.PublishSubscribeChannel - postSend (sent=true) on channel 'errorChannel', message: [Payload=org.springframework.integration.MessageDeliveryException: failed to send message to channel 'downloadChannel' within timeout: -1][Headers={timestamp=1323766396236, id=2c59c498-a554-4c28-b51d-6800cc128a1e}]
Received file message: null
Thanks in advance,
Gunnar