IBM MQ XMS消息侦听器仅获取队列中已经可用的消息,而不是新消息 [英] IBM MQ XMS Message Listener fetching only the Messages which is already available in Queue and not a new one

查看:121
本文介绍了IBM MQ XMS消息侦听器仅获取队列中已经可用的消息,而不是新消息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有用于IBM MQ XMS的Sender和Receiver控制台应用程序.发送者填充队列,接收者使用接收方法使队列管理器出队.我正在使用带有bool值的while循环来继续运行接收器,以便只要队列中有新消息可用,接收器就可以获取该数据.现在,我想将接收者代码更改为异步消息侦听器,而不是consumer.Receive().代码段是

I have Sender and receiver console applications for IBM MQ XMS. The sender populates the Queue and the receiver dequeue the queue manger using receive method. I am using the while loop with bool value to keep running the receiver so that whenever a new message is available in the queue receiver can get that data. Now i want to change the receiver code to Asynchronous Message Listener instead of consumer.Receive(). The code snippet is,

consumerAsync = sessionWMQ.CreateConsumer(destination);                
messageListener = new MessageListener(OnMessageCallBack);
consumerAsync.MessageListener = messageListener;

connectionWMQ.Start();
While(true)
{
    console.writeline("Wait for message");
}

上面的代码仅获取已经可用的数据,而不获取新的数据.例如,如果我在启动接收器应用程序时队列中有2个数据,则这些消息将被下载.但是,当我保持接收器应用程序运行并从发送器应用程序发送新数据时,它没有下载,我必须重新启动接收器应用程序才能获取该数据.类似的情况也可以正常工作同步模式使用者.ReceiveNoWait().

The above code fetches only the already available data and not the new one. For example if i have 2 data in my queue while starting the receiver application those messages getting downloaded. but when i keep the receiver application running and send a new data from sender app its not getting downloaded and i have to restart the receiver application to get that data. The similar scenario was working fine with synchronous mode consumer.ReceiveNoWait().

我想念什么?

推荐答案

XMS版本?9.2版的错误已被IBM 10.28.2020确认.他们正在努力解决.尚无APAR.临时解决方案是将其降级到客户端版本9.1.

Version of XMS? Version 9.2 has a bug that was confirmed by IBM 10.28.2020. They're working on a fix. No APAR yet. Temporary solution would be to downgrade to client version 9.1.

更新:收到基于9.2.0.1 IT34722版本构建的修复程序.经测试还可以.应该与修订包9.2.0.3.一起发布.

Update: Received a fix built on version 9.2.0.1 IT34722. Tested ok. Should be released with fixpack 9.2.0.3.

这篇关于IBM MQ XMS消息侦听器仅获取队列中已经可用的消息,而不是新消息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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