错误消息未重定向到错误通道弹簧集成

时间:2013-12-16 23:17:01

标签: spring spring-integration

/*Below Spring-integration configuration*/
/*Listener*/         
<!--Reading the Message from Queue as a Listener -->
<int-jms:inbound-gateway connection-factory="MQConnectionFactory"
   request-destination="ReadWsRequestQueue"
    request-channel="ReadWsInputChannel"
    transaction-manager="hibernateTransactionManager"
    error-channel="errorReadChannel"/>

/*Processing Message*/
<!--Processing the message-->
<int:chain input-channel="ReadWsInputChannel">
    <int:transformer ref="ReadUnmarshaller"/>
    <int:transformer ref="RequestBuilder" method="build"/>
    <int:service-activator ref="ReadService" method="registerRead" />
    <int:transformer ref="ResponseBuilder" method="buildResponse"/>
    <int:transformer ref="ReadMarshaller"/>
    <int:transformer ref="toStringTransformer"/>

/*Error Channel config*/
<!--Error channel configuration -->
<int:channel id="errorReadChannel"/>
<int:chain input-channel="errorReadChannel">
    <int-jms:outbound-gateway id="jmsOutboundGateway"
        connection-factory="MQConnectionFactory" 
        request-destination="DLQErrorQueue" />
</int:chain>

问题:

在服务Activator方法中,我们抛出一个RuntimeException,它应该被重定向到错误通道?

所有例外都应该转到错误频道

问题2。)

在Spring集成中是否有任何方法可以将异常转发到单独的通道?

0 个答案:

没有答案