DefaultMessageListenerContainer 无法与 Websphere MQ 一起使用

发布于 2024-08-11 22:08:58 字数 1025 浏览 0 评论 0原文

我正在使用 spring 2.5.6 和 spring-integration 1.0.3 以及 MQ 客户端 6.0.2.2

我必须向消息驱动通道适配器添加消息选择器,但现在出现以下错误:

MQJMS2008:打开MQ队列失败;嵌套异常是 com.ibm.mq.MQException: MQJE001: Completion Code 2, Reason 2085

当我使用 ActiveMQ 作为测试工具时它可以工作。

我的配置:

<jms:message-driven-channel-adapter 
    id="jmsIn" 
    channel="inboundMessage" 
    container="myContainer"/>

<bean id="myContainer" 
    class="org.springframework.jms.listener.DefaultMessageListenerContainer">
    <property name="connectionFactory" ref="connectionFactory"/>
    <property name="destinationName" value="myQueue"/>
    <property name="messageSelector" ref="messageSelector"/>
    <property name="transactionManager" ref="txManager"/>
</bean>

如果我恢复到以前的配置,一切都很好(除了我没有消息选择器!)

<jms:message-driven-channel-adapter 
    id="jmsIn" 
    destination="tradeQueue" 
    channel="inboundMessage" 
    transaction-manager="txManager"/>

I am using spring 2.5.6 and spring-integration 1.0.3 and MQ client 6.0.2.2

I have had to add a message selector to my message-driven-channel-adapter, but now I am getting the following error:

MQJMS2008: failed to open MQ queue ; nested exception is com.ibm.mq.MQException: MQJE001: Completion Code 2, Reason 2085

It works when I used ActiveMQ as a test harness.

My configuration:

<jms:message-driven-channel-adapter 
    id="jmsIn" 
    channel="inboundMessage" 
    container="myContainer"/>

<bean id="myContainer" 
    class="org.springframework.jms.listener.DefaultMessageListenerContainer">
    <property name="connectionFactory" ref="connectionFactory"/>
    <property name="destinationName" value="myQueue"/>
    <property name="messageSelector" ref="messageSelector"/>
    <property name="transactionManager" ref="txManager"/>
</bean>

If I revert to my previous configuration it's all good (except I don't have a message selector!)

<jms:message-driven-channel-adapter 
    id="jmsIn" 
    destination="tradeQueue" 
    channel="inboundMessage" 
    transaction-manager="txManager"/>

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

冷弦 2024-08-18 22:08:58

啊!

在我所在的地方,

<property name="destinationName" value="myQueue"/>

我应该让

<property name="destinationName" ref="myQueue"/>

斯卡夫曼是对的,队列实际上并不存在。

Ah!

Where I had

<property name="destinationName" value="myQueue"/>

I should have had

<property name="destinationName" ref="myQueue"/>

Skaffman was right, the queue didn't actually exist.

P

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文