[英]How to stop exception propagation if jms broker is down when sending a message with spring integration?
I configured spring xml based interceptor, which sends a jms message to activemq queue on each invokation of some transactional method after it is commited. 我配置了基于spring xml的拦截器,该拦截器在提交某种事务方法后,每次调用时都会向ActiveMQ队列发送一条jms消息。 It's happening with the following xml code.
以下xml代码正在发生这种情况。
<jms:outbound-channel-adapter channel="filteredStakesChannel" destination="stakesQueue" delivery-persistent="true" explicit-qos-enabled="true" />
But if the activemq server is down i get connection refused exception, which is propagated and i don't want this to happen even if the jms delivery fails. 但是,如果activemq服务器关闭,我会收到连接被拒绝的异常,该异常会传播出去,即使jms传递失败,我也不希望这种情况发生。 Is this possible?
这可能吗? Should i use some error-channel?
我应该使用一些错误通道吗?
The simplest solution is to make fileredStakesChannel an Executor channel and the send will run on a different thread. 最简单的解决方案是使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#executor-channel
http://static.springsource.org/spring-integration/reference/html/messaging-channels-section.html#channel-configuration-executorchannel http://static.springsource.org/spring-integration/reference/html/messaging-channels-section.html#channel-configuration-executorchannel
Use the <task/> namespace to define an executor to use. 使用<task />命名空间定义要使用的执行程序。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.