【问题标题】:Spring-jms Getting Connection from DMLCSpring-jms 从 DMLC 获取连接
【发布时间】:2014-01-24 07:20:56
【问题描述】:

我几乎是 Spring-JMS 的新手。 我正面临着将我的 spring 应用程序连接到 WSO2 Message Broker 的配置。 这是我使用的代码:

代码:

 <jee:jndi-lookup id="connectionFactory" jndi-name="qpidConnectionfactory">
    <jee:environment>
            java.naming.factory.initial=org.wso2.andes.jndi.PropertiesFileInitialContextFactory
        connectionfactory.qpidConnectionfactory=amqp://admin:admin@carbon/carbon?brokerlist='tcp://localhost:5673'
    </jee:environment>
</jee:jndi-lookup>


<bean id="errorHandler" class="it.innovapuglia.sistemapuglia.diogene.spring.subscriber.ErrorH" />
<bean id="messageHandler" class="it.innovapuglia.sistemapuglia.diogene.spring.subscriber.SpringSubscriber" />
<jms:listener-container connection-factory="connectionFactory" 
    destination-type="topic"
    container-type="default" 
    acknowledge="auto" concurrency="3-3"
    error-handler="errorHandler" >
    <jms:listener destination="LEGGI_ATTRIBUTI_DOCUMENTO" ref="messageHandler"  />
</jms:listener-container>

是否有可能使用 DMLC 对其进行子类化并以我可以捕获连接异常的方式获取正在运行的连接? 如果是,以什么方式?

【问题讨论】:

    标签: spring connection wso2 listener spring-jms


    【解决方案1】:

    createConnection() 位于 JmsAccessor(DMLC 的超类)上。

    或者,您可以只向 DMLC 注册您的 ExceptionListener,它将为 JmsException 调用。

    如果您走子类路线,请在 container-class 属性中提供您的类名。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2014-04-17
      • 2018-09-06
      • 2017-05-14
      • 2017-02-14
      • 2017-02-03
      • 2016-01-27
      • 2014-09-16
      相关资源
      最近更新 更多