0

I need to pick up messages off an IBM MQ queue without polling so I am looking at some async sample code from IBM. I see sample code to async get with JMS/XMS but not MQI (amqmdnet).

The closest I have come to not having to poll continuously with MQI is to wait, but not advised of course for long periods of time so you are still polling:

requestMessage = new MQMessage();
MQGetMessageOptions gmo = new MQGetMessageOptions();
gmo.Options = MQC.MQGMO_WAIT;

Is there a way to asynchronously get messages off a queue using MQI? Or is XMS the only way to go?

Justin Bertram
  • 29,372
  • 4
  • 21
  • 43
sac80644
  • 103
  • 1
  • 5
  • 2
    As commented in the other question XMS is the only .NET IBM MQ API that supports async get. – JoshMc Nov 11 '19 at 21:19
  • It's unclear to me what this question really has to do with JMS. It appears related to IBM MQ and XMS. Can you clarify how JMS is directly relevant here? – Justin Bertram Nov 11 '19 at 22:44
  • The MQI has MQCB and MQCTL verbs to do asynchronous consume. There seems to be an assumption that you want .NET in the comments, but I don't see it in your question hence I'm leaving this comment here to see what you say. I can write a full answer if you really do want MQI. – Morag Hughson Nov 11 '19 at 23:27
  • @MoragHughson, the question states "but not MQI (amqmdnet). That is the name if the DLL used for .NET. – JoshMc Nov 12 '19 at 04:14
  • @JoshMc - thanks, I saw that and was hoping the OP would answer to confirm. – Morag Hughson Nov 12 '19 at 21:19
  • Here is the OP's original question: https://stackoverflow.com/questions/58772388/what-is-the-difference-between-a-queue-and-topic-in-ibm-mq – JoshMc Nov 12 '19 at 23:28
  • @MoragHughson thanks for your reply, sorry this is late. I went ahead with an XMS implementation. .NET is required but I was curious if MQI could support async get as well. I thought JoshMc said only XMS supports asyn get in a previous post so I went ahead with XMS. – sac80644 Dec 02 '19 at 20:41
  • The MQI (i.e. the native non-OO MQ API) supports Async Consume as my original comment notes. I'm guessing your question is whether the .NET classes for MQ support it? From what I can tell (not being an expert in this API I had to look it up), I would say it does not. – Morag Hughson Dec 03 '19 at 08:33

0 Answers0