【发布时间】:2018-02-04 16:53:04
【问题描述】:
我有:
- 骆驼路由 (transacted=true),从 MQ 队列消费
- 使用 Spring 的 WebSphereUowTransactionManager
- 事务性有效
- 在 IBM Liberty 上运行
但是,我收到了这条消息:
Setup of JMS message listener invoker failed for destination 'MY.QUEUE' - 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.
这似乎与此other Stack Overflow question 相关,但我已尝试更改 server.xml 中的配置,但没有成功。
【问题讨论】:
-
您可以尝试设置cacheLevelName=CACHE_CONSUMER。
-
Darius,对克劳斯·易卜生的建议有什么意见吗?你能展示你完整的骆驼路线吗?
-
@JoshMc,是的,我刚刚尝试过,它奏效了。我使用了 CACHE_NONE,因为我不知道事务是否可以与其他选项一起正常工作(我正在使用 Spring 的 WebSphereUowTransactionManager)
-
@ClausIbsen 应该写一个你可以接受并奖励赏金的答案。
-
更新:我们实际上无法让事务与 CACHE_CONSUMER 一起正常工作,因此,切换回 CACHE_NONE
标签: apache-camel ibm-mq