首页 文章

使用多个 Actuator 的spring集成

提问于
浏览
0

我有一个 spring integration configuration ,我从一个目录中查询文件,然后在后面的步骤中处理这些文件 .

我正在使用 dispatcher channel 处理步骤,允许释放轮询线程并返回以在处理步骤发生时继续进行轮询 .

这个工作正常,直到达到线程池限制,此时由于 CALLER_RUNS 拒绝策略,当轮询器将文件提交到处理步骤时,它最终在与轮询器相同的线程中进行处理,该轮询器停止轮询进程被放置停止直到此步骤完成 .

我该如何c * ompletely decouple the two stages* 这个过程?

我的想法是使用两个 task-executors ,一个用于投票,另一个用于调度员,但这似乎没有帮助 .

<!-- Poll files from landing zone directory -->
<int-file:inbound-channel-adapter id="files" directory="${lz.dir.${ft}}" filename-regex=".*\.txt$">
    <int:poller fixed-delay="3000" max-messages-per-poll="2" task-executor="pollingExecutor" />
</int-file:inbound-channel-adapter>

<int:bridge input-channel="files" output-channel="sourceFiles" />

<!-- Dispatch retrieved files -->
<int:channel id="sourceFiles">
    <int:dispatcher task-executor="processingExecutor" />
</int:channel>

基本上我希望轮询过程永远不会停止 . 任何帮助,将不胜感激 .

谢谢

1 回答

  • 0

    使用 QueueChannel ; poller将文件转储到队列中,另一方面有一个轮询器将消息拉出队列 .

    默认情况下,队列是无限制的 .

    或者,当然,您可以在执行程序中使用无界队列 .

    但如果你的消费者无法跟上,你最终会遇到麻烦 .

相关问题