繁体   English   中英

使用Spring Integration发送消息时,如果JMS Broker关闭,如何停止异常传播?

[英]How to stop exception propagation if jms broker is down when sending a message with spring integration?

我配置了基于spring xml的拦截器,该拦截器在提交某种事务方法后,每次调用时都会向ActiveMQ队列发送一条jms消息。 以下xml代码正在发生这种情况。

<jms:outbound-channel-adapter channel="filteredStakesChannel" destination="stakesQueue" delivery-persistent="true" explicit-qos-enabled="true" />

但是,如果activemq服务器关闭,我会收到连接被拒绝的异常,该异常会传播出去,即使jms传递失败,我也不希望这种情况发生。 这可能吗? 我应该使用一些错误通道吗?

最简单的解决方案是使fileredStakesChannel成为执行程序通道,并且发送将在其他线程上运行。

http://static.springsource.org/spring-integration/reference/html/messaging-channels-section.html#executor-channel

http://static.springsource.org/spring-integration/reference/html/messaging-channels-section.html#channel-configuration-executorchannel

使用<task />命名空间定义要使用的执行程序。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM