【问题标题】:Spring Integration Executor Channel loosing itemsSpring Integration Executorchannel 丢失项目
【发布时间】: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


【解决方案1】:

它们没有丢失,它们在排队 - 5 个线程在做什么?使用 jstack 或 VisualVM 进行线程转储。

我猜你的网关正在等待回复。

【讨论】:

  • 在等待回复时似乎真的挂了。用网桥替换网关解决了这个问题。
猜你喜欢
  • 2013-11-13
  • 1970-01-01
  • 1970-01-01
  • 2016-09-27
  • 2023-02-06
  • 2014-03-24
  • 2016-12-21
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多