【发布时间】:2014-10-23 11:33:02
【问题描述】:
由于某种原因,以下 Executor Channel 仅处理 5 个项目并丢弃其余项目:
<task:executor id="ImportItemExecutor" pool-size="5"/>
<channel id="ImportItemChannel" datatype="com.processing.data.generic.ImportItem,java.lang.String">
<dispatcher task-executor="ImportItemExecutor"/>
</channel>
输入看起来像这样:
<!-- Processing: Create IMPORT_SOURCE, prepare file as resource, and let the kernel handle the processing -->
<chain id="ProcessingXmlChain" input-channel="FullEarningsResponseChannel" output-channel="ImportItemChannel">
[Code shortened]
<splitter id="FullEarningsSplitter" ref="FullEarningsSplitterBean"/>
</chain>
唯一的消费者看起来像这样:
<chain id ="ImportItemChain" input-channel="ImportItemChannel" output-channel="ReportedFileChannel">
<!-- Call the main processing pipeline which returns a Report object as payload -->
<gateway request-channel="ResultRouterChannel" error-channel="errorChannel"/>
<!-- Outgoing payload must be the processed file -->
<transformer expression="headers.file_xml"/>
</chain>
这种奇怪行为的原因可能是什么? 怎么解决?
【问题讨论】:
-
也许这也是相关的:如果我使用的是普通频道,则只会处理第一项。
-
你的
ResultRouterChannel子流必须返回一条消息,否则你的线程挂起等待reply并最终阻止线程池中的线程。
标签: spring-integration channel