Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/backbone.js/2.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
Spring integration int ftp:入站通道适配器轮询器控制_Spring Integration - Fatal编程技术网

Spring integration int ftp:入站通道适配器轮询器控制

Spring integration int ftp:入站通道适配器轮询器控制,spring-integration,Spring Integration,我们使用intftp:带有固定速率轮询器的入站通道适配器。出于维护目的,我们希望能够在需要时停止轮询器(使用url)。我们使用下面的适配器配置 <int-ftp:inbound-channel-adapter id="inboundAdapter" channel="inputChannel" session-factory="sessionFactory" charset="UTF-8" auto-create-local-directory="false

我们使用intftp:带有固定速率轮询器的入站通道适配器。出于维护目的,我们希望能够在需要时停止轮询器(使用url)。我们使用下面的适配器配置

<int-ftp:inbound-channel-adapter id="inboundAdapter"
        channel="inputChannel" session-factory="sessionFactory"
        charset="UTF-8" auto-create-local-directory="false"
        delete-remote-files="true" filename-regex="^.*\.(txt|in)$"
        remote-directory="${remote.directory}" local-directory="${local.directory}">
        <poller max-messages-per-poll="-1" fixed-rate="3000" error-channel="errorChannel"/>
    </int-ftp:inbound-channel-adapter>

下面是我们需要添加到此适配器的行为

  • 我们希望继续进行固定费率轮询
  • 我们不希望在任何时候将文件保存在本地目录中,本地目录是一个云容器位置
  • 当我们点击一个url时,轮询器不应该接受固定速率的轮询(这意味着,不要将文件从远程目录拉到本地目录),但是本地目录中的任何暂存文件都应该被完全处理
  • 我们需要另一个处理程序以固定速率轮询方式启动轮询器

  • 任何修改适配器以实现此目的的建议都很有帮助。

    要实现此目的,请将适配器的输出通道设置为
    nullChannel

    添加
    以轮询本地目录

    停止ftp适配器的轮询器,远程回迁将停止(在当前轮询完成后,如果正在进行),但文件适配器将继续轮询本地目录

    要停止/启动ftp适配器,请使用
    @Autowired
    SourcePollingChannelAdapter或使用控制总线。

    从5.0版开始(GA将于今年晚些时候发布,里程碑4现在可用),您现在可以将适配器的
    MessageSource
    maxFetchSize
    属性设置为0以禁用远程抓取,继续轮询本地目录以查找以前获取的文件。这可以通过编程或通过控制总线来完成。