Spring integration Spring集成-屏障和路由器
我试着用这里的例子, 因此,不要用线条:Spring integration Spring集成-屏障和路由器,spring-integration,Spring Integration,我试着用这里的例子, 因此,不要用线条: <int:splitter input-channel="processChannel" output-channel="process" order="1" /> 并返回下一行: this.logger.error("Suspending thread timed out or did not arrive within timeout for: " + message); 同步队列大小为0 线程返回后,它尝试释放,但随后再次挂起: M
<int:splitter input-channel="processChannel" output-channel="process" order="1" />
并返回下一行:
this.logger.error("Suspending thread timed out or did not arrive within timeout for: " + message);
同步队列大小为0
线程返回后,它尝试释放,但随后再次挂起:
Message<?> releaseMessage = syncQueue.poll(this.timeout, TimeUnit.MILLISECONDS);
Message releaseMessage=syncQueue.poll(this.timeout,TimeUnit.ms);
获取null并最终在屏障超时时抛出ReplyRequiredException。
这里似乎有很好的逻辑…:)
你能告诉我我在这里遗漏了什么吗?为什么这个路由器不在这里?问题是,在这种情况下,您试图释放与要挂起的线程相同的线程上的屏障 在这种情况下(因为所有拆分都跳过了
过程
),所以释放发生在挂起之前
屏障的工作方式是,如果释放首先发生,该线程将等待挂起的线程到达。既然是同一条线,它就永远不会发生
请注意,process
是一个队列通道-这些消息被传递给另一个线程。因此,您需要另一个队列通道来进行“跳过”拆分
是的,完全正确-提出了“报价”,但没有发布挂起的线程。。。现在很好用——魔法!;)我假设:output channel=“transform”
也可以在屏障配置中替换为output channel=“nullChannel”
(只是在末尾省略DestinationResolutionException)。谢谢+1
this.logger.error("Suspending thread timed out or did not arrive within timeout for: " + message);
Message<?> releaseMessage = syncQueue.poll(this.timeout, TimeUnit.MILLISECONDS);
<int:router input-channel="someCheckGate" apply-sequence="false" default-output-channel="toAgg" expression="1 eq 1">
<int:mapping value="true" channel="toAgg"/>
<int:mapping value="false" channel="toAgg"/>
</int:router>
<int:channel id="toAgg">
<int:queue />
</int:channel>
<int:bridge input-channel="toAgg" output-channel="aggregatorChannel">
<int:poller fixed-delay="1000" />
</int:bridge>
<int:channel id="aggregatorChannel">
<int:dispatcher task-executor="exec" />
</int:channel>