spring integration router unresolved channel id

时间:2014-11-18 13:50:38

标签: spring-integration

我已阅读文档,但我找不到我要找的内容,即: 有没有办法在这样定义的路由器抛出MessageDeliveryException(如果它无法从有效负载中解析出一个通道):

<int:payload-type-router input-channel="exceptionIntegrationGatewayInbound"
        resolution-required="true" id="typePayloadRouterError">
        <int:mapping type="package.class"
            channel="channelDest" />
</int:payload-type-router>

路由器定义中指定的ID? (例如 typePayloadRouterError )。 就像过滤器拒绝消息时发生的情况非常类似,如下所示:

<int:filter expression="(payload.operationResult?.equals('0')?:false)"
            throw-exception-on-rejection="true" />

我要求已经实施的东西或无用的东西吗? (如果有人没有在消息链中放入有意义的日志,那么它真的有助于调试/找到它破坏的地方。)

感谢。

1 个答案:

答案 0 :(得分:0)

是的,你是对的。相关代码中没有这样的信息。它看起来像这样(AbstractMessageRouter):

else {
    throw new MessageDeliveryException(message,
        "no channel resolved by router and no default output channel defined");
}

来自MessageFilter的类似内容:

if (this.throwExceptionOnRejection) {
    throw new MessageRejectedException(message, "MessageFilter '" + this.getComponentName()
            + "' rejected Message");
}

所以,我想您可以就此问题提出JIRA问题。

如果您提供contribution,那就太棒了。

顺便说一句:这里有什么不好的,没有任何解决方法可以克服你的要求。