Spring integration Spring集成丢弃消息到replyChannel
我有一条嵌套链。我想在内链中添加一个过滤器,以便它可以在特定条件下继续流动或从链中退出。如果我没有设置丢弃通道或将丢弃通道设置为“nullChannel”,它将挂起。因此,我想到了路由到replyChannel,它由Spring在头文件中设置。使用下面的配置,我将获得SpelEvaluationException。如何将放弃频道设置为replyChannel?请注意,由于我想多次拨打childChannel,replyChannel并不总是相同的Spring integration Spring集成丢弃消息到replyChannel,spring-integration,Spring Integration,我有一条嵌套链。我想在内链中添加一个过滤器,以便它可以在特定条件下继续流动或从链中退出。如果我没有设置丢弃通道或将丢弃通道设置为“nullChannel”,它将挂起。因此,我想到了路由到replyChannel,它由Spring在头文件中设置。使用下面的配置,我将获得SpelEvaluationException。如何将放弃频道设置为replyChannel?请注意,由于我想多次拨打childChannel,replyChannel并不总是相同的 <int:chain id="paren
<int:chain id="parentChain" input-channel="request">
....
<int:gateway request-channel="childChannel" />
<int:header-enricher .. </header-enricher>
<int:gateway request-channel="childChannel" />
....
</int:chain>
<int:chain input-channel="childChannel">
..
<int-xml:xpath-filter discard-channel="#{headers['replyChannel']}">
<int-xml:xpath-expression expression="" />
</int-xml:xpath-filter>
..
</int:chain>
....
不确定你的逻辑是否正确,但你真的不能这样放弃
您可以这样做:
<int-xml:xpath-filter discard-channel="discardChannel">
...
<int:header-value-router input-channel="discardChannel" header-name="replyChannel"/>
...
Filter
模式(及其各自的组件)用于那些不应该发送到主下游的消息
我只是觉得你应该用一些不同的东西,而不是
。谢谢你的回答。我想用路由器代替过滤器,但我只有一个条件,除了返回原始流之外,没有任何流。我想使用内链中的过滤器来防止内链中的其他流,它仍然需要在主链中执行流。好的。这是您的应用程序,我相信最终您将能够使您的解决方案更加直观。现在,如果你发现我的答案是正确的,就接受它,让我们继续吧!你的建议对我想要的非常有效,谢谢。