【问题标题】:How to stop exception propagation if jms broker is down when sending a message with spring integration?如果在使用 Spring 集成发送消息时 jms 代理关闭,如何停止异常传播?
【发布时间】:2012-11-07 09:04:59
【问题描述】:

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

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

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

【问题讨论】:

    标签: spring jms activemq spring-integration


    【解决方案1】:

    最简单的解决方案是将 fileredStakesChannel 设置为 Executor 通道,发送将在不同的线程上运行。

    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

    使用 命名空间来定义要使用的执行器。

    【讨论】:

      猜你喜欢
      • 2016-02-23
      • 1970-01-01
      • 2021-03-17
      • 2018-07-30
      • 1970-01-01
      • 2012-11-05
      • 1970-01-01
      • 2018-04-15
      • 1970-01-01
      相关资源
      最近更新 更多