MQ

MQ

Join this online group to communicate across IBM product users and experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.

 View Only
  • 1.  MQPUT1 Question from before

    Posted 11/08/24 06:01 PM

    @Morag Hughson

    I have modified my code to this:

                            queueManager = new MQQueueManager(parms.PutQueueManager, properties);
                            queue = queueManager.AccessQueue(parms.PutQueueName, MQC.MQOO_OUTPUT + MQC.MQOO_FAIL_IF_QUIESCING, parms.PutReplyToQMgr, parms.PutReplyToQ, "" );

    The last three arguments I am slightly unsure of but I believe the first two are the reply info I got from the incoming message.   I assume the first argument 'queuename' is the queue I read the msg from?   They MQ people on the mainframe have not said anything about an alternateuserid so I hope leaving it blank will be ok...

    Since its a Request/Reply arrangement, I am seeing things work differently than what we had been doing..   Before I read from Queue A at Mgr 1 & replied to queue B at Mgr 1...  Using the internal ReplyTo fields is something I have had no experience with yet..



    ------------------------------
    Richard Rasmussen Mgr. Software Development
    ------------------------------


  • 2.  RE: MQPUT1 Question from before

    Posted 11/08/24 06:52 PM

    I think it goes like this:-

    queue = queueManager.AccessQueue(parms.PutReplyToQ, MQC.MQOO_OUTPUT + MQC.MQOO_FAIL_IF_QUIESCING, parms.PutReplyToQMgr,"","");

    So, it is not the queue that you read the message from but the queue you want to put the reply to.

    ThMQQueue class documentation says of the dynamicQueueName parameter (#4) that it is ignored unless the first queue name parameter (#1) is a MODEL queue, which yours is not.

    I am happy to hear that you are learning about a new thing. Request/Reply is a very common model. It allows the application reading the requests and building the replies to be able to handle any reply destination. The reply destination doesn't have to be part of the parms to the application, but instead pulled out of the request message. Using both the ReplyToQ and ReplyToQMgr fields is also best practice and allows applications making the request and processing the request to connect to different queue managers.

    See whether the code above gets it working.

    Feel free to ask more questions here if you want to know more about Request/Reply pattern.

    Cheers,
    Morag



    ------------------------------
    Morag Hughson
    MQ Technical Education Specialist
    MQGem Software Limited
    Website: https://www.mqgem.com
    ------------------------------



  • 3.  RE: MQPUT1 Question from before

    Posted 11/08/24 07:27 PM

    I am going to give it a spin as soon as possible.  I can't thank you enough for this very useful explanation of how it all goes together...!



    ------------------------------
    Richard Rasmussen Mgr. Software Development
    ------------------------------