2

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");
}

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().

What am I missing?

JoshMc
  • 10,239
  • 2
  • 19
  • 38
Arunn STS
  • 23
  • 3
  • That can't be true. Have you tried running SimpleAsyncConsumer sample or SampleConsumerCS sample shipped with the product? – Shashi Oct 28 '20 at 11:52
  • I tried the SimpleAsyncConsumer sample and other sample codes available in online too but got same result. – Arunn STS Oct 28 '20 at 12:07
  • Any resolution to this please? I am using v9.2.4 of IBMXMSDotnetClient (via Nuget) and this appears to still be the problem. – Brett Rigby Feb 23 '22 at 05:44

2 Answers2

5

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.

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

kaseidu
  • 173
  • 1
  • 6
  • I am using IBMXMSDotnetClient v9.2.0.1. Let me downgrade to 9.1 and check. Thanks for the information. – Arunn STS Oct 28 '20 at 12:08
  • after downgrade i am able to receive the message but when i send 4 data's only the first message is received and the remaining data's not downloading do i need to give some callback to MQ that message has been received? or once a message is received have to close the current session and start a new one? Kindly advise me – Arunn STS Oct 28 '20 at 12:24
  • Take a look at the sample application "SimpleAsyncConsumer". It should receive all messages within a timeout set inline (30 sec). Default location is: C:\Program Files\IBM\MQ\tools\dotnet\samples\cs\xms\simple\wmq\SimpleAsyncConsumer – kaseidu Oct 28 '20 at 12:29
  • It depends on if this is a "Transacted" session or not, and if it is not, what the acknowledgement mode is. Can you add how you create the session to the question? – JoshMc Oct 28 '20 at 14:34
  • @JoshMc Its not a transacted session, the session is created by ISession _session = _connection.CreateSession(false, AcknowledgeMode.AutoAcknowledge); – Arunn STS Oct 28 '20 at 17:28
  • This is still an issue for us. 9.1.3 works. 9.1.4 and up does not. Picks up messages that are already on the queue or the first message(s) dropped. After that, will not pick up any. Just tried 9.2.0.2 and the latest 9.2.2.0. – sac80644 Apr 19 '21 at 19:07
  • Sorry to say that IBM did not include IT34722 in fixpack 9.2.0.2. – kaseidu Apr 21 '21 at 10:19
  • Not included in 9.2.0.3 either. Created a new support case asking for an estimate on release. The response was: "not yet known". – kaseidu Aug 24 '21 at 06:01
  • 2
    The APAR [IT34722](https://www.ibm.com/support/pages/apar/IT34722) closed today and does show fixed in 9.2.0.4 and 9.2.5. – JoshMc Oct 15 '21 at 02:29
  • Does it work for someone on XMS version 9.2.0.4 from nuget? I downgraded from 9.2.4 (9.2.5 is scheduled for Q1 2022) and it still doesn't work for me. That's why I am curious if there is a problem with my code or if this version still doesn't fix it. – grzegorzorwat Dec 29 '21 at 16:17
  • 9.2.0.4 seems to have fixed the bug for my client. Dropped messages, waited, dropped more it picked them up. – sac80644 Jan 31 '22 at 19:57
2

I have posted a support-case to ibm on this issue a long time ago(81 days...) Long time for such a bug. The apar is IT34722 but at the date is still in open status.

9.1.3 might work but have other problems/bugs and will not be found as nuget-package

Daniel
  • 21
  • 2
  • @TomerShetah you can not link to a IBM APAR until IBM closes the APAR. Based on what Daniel described he has the APAR number because IBM provided it to him via a case. This is good information to have for others experiencing the same problem and once the APAR is closed Daniel should provide a link to the APAR page from IBM. – JoshMc Jan 11 '21 at 16:01
  • I found that downgrading to the lowest nuget package, 9.1.4, broke connection to a v8 server. Would get MQRC_UNEXPECTED_ERROR until I upgraded back to 9.2.3 – r590 Aug 05 '21 at 23:32
  • Here is the apar. https://www.ibm.com/support/pages/apar/IT34722 – Daniel Oct 15 '21 at 19:34