【发布时间】:2021-04-12 18:59:36
【问题描述】:
我有一个要求,我需要将消息传递到多个通道 asyc。为了使我的流程异步,我正在使用所有执行程序通道。但由于某种原因,流程仍然是顺序的。我可以看到我在任务执行器中配置的差异线程,但按顺序排列。 这是我正在使用的配置
<int:channel id="mainChannel">
<int:interceptors>
<int:wire-tap channel="channel1"/>
<int:wire-tap channel="channel2"/>
<int:wire-tap channel="channel3"/>
</int:interceptors>
</int:channel>
<int:channel id="channel1">
<int:dispatcher task-executor="exec1" />
</int:channel>
<int:channel id="channel2">
<int:dispatcher task-executor="exec2" />
</int:channel>
<int:channel id="channel3">
<int:dispatcher task-executor="exec3" />
</int:channel>
据我了解,所有这些都是异步的(在我的情况下,3 个线程应该并行运行)
从日志中我可以看到所有顺序但具有不同的线程名称.. 我假设 preSend/Postsend 应该以随机顺序调用。
我是否缺少任何东西来并行创建多个执行器通道。
我将非常感谢任何帮助。
【问题讨论】:
标签: java spring spring-integration