我正在尝试使用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)
请输入任何内容。
答案 0 :(得分:0)
此问题是由于重复的id.Id与其他适配器冲突。
更改了ID并解决了问题。