0

我正在尝试使用 SFTP 适配器将文件推送到 ftp。但它表示无法将消息发送到通道。

我的配置是

<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)

请输入任何内容。

4

1 回答 1

0

这个问题是因为重复的 id.Id 与其他适配器冲突。

换了ID,问题解决了。

于 2013-09-27T07:02:52.947 回答