2013-09-27 134 views
0

我正試圖使用​​SFTP適配器將文件推送到ftp。但它表示無法將消息發送到通道。sftp彈簧集成未能在超時內向消息發送消息:-1

我的配置是

<int:publish-subscribe-channel id="publishToSFTPChannel" ></int:publish-subscribe-channel> 


<file:inbound-channel-adapter 
directory="file:#{configurationService.configuration.getProperty('csv.export.file.location')}" 
id="fileInbound" channel="publishToSFTPChannel" filename-pattern="*.csv" > 
<int:poller fixed-rate="11000" max-messages-per-poll="100"/> 
</file:inbound-channel-adapter> 


<int-sftp:outbound-channel-adapter id="sftpOutboundAdapter" 
session-factory="sftpSessionFactory" 
channel="publishToSFTPChannel" 
charset="UTF-8" 
remote-directory="#{csvRemoteDirectory}" 
remote-file-separator="/" order="1" /> 


<file:outbound-channel-adapter id="moveProcessedFile" 
    channel="publishToSFTPChannel" 
    directory="file:#{configurationService.configuration.getProperty('auspost.csv.export.file.location')}/${tenantId}/processed" 
    delete-source-files="true" order="2" /> 

我看到的錯誤是

ERROR [task-scheduler-2] [ErrorHandler] unexpected exception caught 
org.springframework.integration.MessageDeliveryException: failed to send message to channel 'publishToSFTPChannel' 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.endpoint.SourcePollingChannelAdapter.doPoll(SourcePollingChannelAdapter.java:97) 
    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:53) 
    at org.springframework.scheduling.concurrent.ReschedulingRunnable.run(ReschedulingRunnable.java:81) 

任何輸入請。

回答

0

此問題是由於重複的id.Id與其他適配器衝突。

更改了ID並解決了問題。