Camel 应用程序在关闭会话后尝试使用 JMS 会话 [英] Camel The application attempted to use a JMS session after it had closed the session

查看:33
本文介绍了Camel 应用程序在关闭会话后尝试使用 JMS 会话的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是骆驼的新手,我正在尝试在 JBoss EAP 7 上编写一个桥接 Websphere MQ 和 Active MQ 的应用程序.该应用程序部署成功运行,我可以在 Websphere 队列上放置消息,并且它被 Active 接收MQ.但是,我在日志中看到错误消息,显示它在打开后尝试使用连接.

I am new to camel and I am attempting to write an app that bridges Websphere MQ and Active MQ on JBoss EAP 7. The app deploys successfully works, I can drop messages on the Websphere queue, and it gets picked up by Active MQ. However I see error messages in the log showing it is attempting to use a connection after it is open.

15:48:57,814 ERROR [org.jboss.jca.core.connectionmanager.listener.TxConnectionListener] (Camel (camel) thread #1 - JmsConsumer[I0_TEST]) IJ000315: Pool IbmMQQueueFactory has 1 active handles
15:48:57,819 INFO  [org.jboss.as.connector.deployers.RaXmlDeployer] (Camel (camel) thread #1 - JmsConsumer[I0_TEST]) wmq.jmsra.rar: MQJCA4016:Unregistered connection handle being closed: 'com.ibm.mq.connector.outbound.ConnectionWrapper@214da401'.
15:49:02,819 WARN  [org.apache.camel.component.jms.DefaultJmsMessageListenerContainer] (Camel (camel) thread #1 - JmsConsumer[I0_TEST]) Setup of JMS message listener invoker failed for destination 'I0_TEST' - trying to recover. Cause: Local JMS transaction failed to commit; nested exception is com.ibm.msg.client.jms.DetailedIllegalStateException: MQJCA1020: The session is closed.
The application attempted to use a JMS session after it had closed the session.
Modify the application so that it closes the JMS session only after it has finished using the session.

这是我的 applicationContext.xml

Here is my applicationContext.xml

<bean id="jmsConnectionFactory" class="org.springframework.jndi.JndiObjectFactoryBean">
    <property name="jndiName" value="java:/ConnectionFactory" />
    <property name="lookupOnStartup" value="false" />
    <property name="cache" value="true" />
    <property name="proxyInterface" value="javax.jms.ConnectionFactory" />
</bean>

<bean id="jmsTransactionManager"
    class="org.springframework.transaction.jta.JtaTransactionManager">
    <property name="transactionManagerName" value="java:/TransactionManager" />
</bean>

<bean id="jms" class="org.apache.camel.component.jms.JmsComponent">
    <property name="connectionFactory" ref="jmsConnectionFactory" />
    <property name="transacted" value="true" />
    <property name="transactionManager" ref="jmsTransactionManager" />
</bean>

<bean id="wmqConnectionFactory" class="org.springframework.jndi.JndiObjectFactoryBean">
    <property name="jndiName" value="java:/jms/IbmMQMsgQCF" />
    <property name="lookupOnStartup" value="false" />
    <property name="cache" value="true" />
    <property name="proxyInterface" value="javax.jms.ConnectionFactory" />
</bean>

<bean id="wmqTransactionManager"
    class="org.springframework.transaction.jta.JtaTransactionManager">
    <property name="transactionManagerName" value="java:/TransactionManager" />
</bean>

<bean id="wmq" class="org.apache.camel.component.jms.JmsComponent">
    <property name="connectionFactory" ref="wmqConnectionFactory" />
    <property name="transacted" value="true" />
    <property name="transactionManager" ref="wmqTransactionManager" />
</bean>


<bean id="routerlogger" class="org.jboss.as.quickstarts.mdb.RoutLogger" />

<camelContext trace="true" id="camel"
    xmlns="http://camel.apache.org/schema/spring">

    <route>
        <from uri="wmq:websphereQueue"/>
        <setExchangePattern pattern="InOnly"/>
        <to uri="jms:activeQueue" pattern="InOnly" />
    </route>
</camelContext>

这是一个简单的应用程序,试图确定我遗漏了什么.

Its a simple app, trying to determine what I'm missing.

推荐答案

我发现了这个 JBossDeveloper 错误 "JBEAP-2344:UserTransaction commit(), rollback() 关闭 Websphere MQ 7.5 中的连接",它看起来描述了您的问题,并有指向文档更新JBEAP-3535:文档:添加关于在 commit() 和 rollback() 上关闭连接以部署 WebSphere MQ 资源适配器子章节的注释.

I found this JBossDeveloper bug "JBEAP-2344: UserTransaction commit(), rollback() closes connection in Websphere MQ 7.5" which looks like it describes your issue and has comments pointing to documentation update "JBEAP-3535: Documentation: Add note about connection close on commit() and rollback() to Deploy the WebSphere MQ Resource Adapter subchapter".

您能否添加一个注释,设置 tracking="false" 可以解决WebSphere MQ 7.5 和 8 的问题,其中方法 commit() 或在 UserTransaction 上的 rollback() 关闭任何 JMS 连接本次交易的一部分.这部分与记录已知WebSphere MQ 在JBEAP-3142.

Could you please add a note, that setting tracking="false", solves problem with WebSphere MQ 7.5 and 8, where method commit() or rollback() on UserTransaction closes any JMS connections which was part of this transaction. This part is related to documenting known limitation of WebSphere MQ in JBEAP-3142.

这篇关于Camel 应用程序在关闭会话后尝试使用 JMS 会话的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆