Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/spring/12.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 重试Spring集成FTP入站通道适配器_Java_Spring_Spring Integration - Fatal编程技术网

Java 重试Spring集成FTP入站通道适配器

Java 重试Spring集成FTP入站通道适配器,java,spring,spring-integration,Java,Spring,Spring Integration,目前我有一个基本的FTP入站通道适配器,配置了轮询器 <int-ftp:inbound-channel-adapter id="ftpInboundChannelAdapter"> <int:poller cron="#{fooProperties['foo.ftp.cron']}" max-messages-per-poll="-1" /> </int-ftp:inbound-channel-adapter> 在这种情况下,我们希望“rep

目前我有一个基本的FTP入站通道适配器,配置了轮询器

<int-ftp:inbound-channel-adapter id="ftpInboundChannelAdapter">
        <int:poller cron="#{fooProperties['foo.ftp.cron']}" max-messages-per-poll="-1" />
</int-ftp:inbound-channel-adapter>
在这种情况下,我们希望“repoll”,一个可配置的次数

我读过关于
int:request-handler-advice-chain
的文章,但是看起来你不能在FTP适配器的轮询器上使用它


我正在使用SI 2.2.6,但如果需要可以升级

您可以使用自定义的
触发器
bean而不是cron触发器

向轮询器添加一个
错误通道
,以捕获异常,并在错误通道流上,在触发器bean中设置发生错误的某些状态

如果没有发生错误,请返回明天调用
nextExecutionTime()
时要运行的时间

如果发生错误,请返回要重试的时间(并重置错误状态)

org.apache.commons.net.ftp.FTPConnectionClosedException: FTP response 421 received.  Server closed connection.