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.  CCDT JSON and Client Not Connecting

    Posted Wed October 25, 2023 10:01 AM
    Edited by Kevin Cobb Wed October 25, 2023 10:26 AM

    Recently moved from the TAB file to using JSON but have had random issues with the client connection failing (have two MQ servers and the client JSON is defined to balance between the two). On one set of servers, this client erred for a couple of weeks and it just started working. On another set of servers, the client isn't working but the issue is random, sometimes it erred and sometimes it is successful. Not sure how to debug this. 

    The JSON file is on the local file system, and the MQCHLIB and MQCHLTAB are set correctly. I am getting nothing in the log files. This is on Windows 2019 servers (the MQ server side is on Linux). 

    Error  is MQRC_Q_MGR_NAME_ERROR. And I have validated the JSON against the schema. 

    ------------------------------
    Kevin Cobb
    ------------------------------



  • 2.  RE: CCDT JSON and Client Not Connecting

    Posted Thu October 26, 2023 03:14 AM
    Edited by Francois Brandelik Thu October 26, 2023 03:16 AM

    Instead of using the qmgr name as provided in the JSON file for the connection, have you thought of using *qmgr for the connection when qmgr is provided in the JSON file? Works the same as the tab file worked in this reguard.

    Did you check if you had any other queue manager set up with the same qmgr name in the JSON file (may be from copy/paste operations)?



    ------------------------------
    Francois Brandelik
    ------------------------------



  • 3.  RE: CCDT JSON and Client Not Connecting

    Posted Fri October 27, 2023 08:46 AM

    Yes, we are using the *QMGR name to let the client automatically dermine which queue manager on which server to choose. 



    ------------------------------
    Kevin Cobb
    ------------------------------



  • 4.  RE: CCDT JSON and Client Not Connecting

    Posted Thu October 26, 2023 06:09 AM

    Hi Kevin,

    The intermittent nature of the error you are seeing suggests that maybe only one of the two entries in the JSON CCDT has an error in it.

    The error MQRC_Q_MGR_NAME_ERROR (2058) occurs when a client connection is being attempted and a CCDT is in use, if the provided queue manager name (i.e. the one you supply on the MQCONN(X) call, is not found as a QMNAME value in any of the entries in the CCDT. What value do you supply at MQCONN(X) time, and what value is in the QMNAME in each CCDT entry?

    Is it possible for you to show us the contents of your JSON CCDT (perhaps with any private info redacted)?

    Cheers,
    Morag



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



  • 5.  RE: CCDT JSON and Client Not Connecting

    Posted Fri October 27, 2023 08:56 AM

    Thanks for your suggestion. I checked the two connections in the CCDT JSON and they are correct. Also, the problem just seems to go away after a few days. I theorized that the problem is that the service user (windows machines) can't get the environment variables (MQCHLLIB and MQCHLTAB) and that somehow (machine reboot or service restart), eventually, they can. But not sure that theory agress with what you indicated as the underlying issue behind MQRC_Q_MGR_NAME_ERROR. Also, as I stated in the other reply, we are using *QMGR as the connection value for the "ClientConnectionChannelName", see below C# code. 

                    var props = new Hashtable();
                    props.Add(MQC.TRANSPORT_PROPERTY, MQC.TRANSPORT_MQSERIES_MANAGED);
                    MqQueueManager = new MQQueueManager(smp.ClientConnectionChannelName, props);
     



    ------------------------------
    Kevin Cobb
    ------------------------------



  • 6.  RE: CCDT JSON and Client Not Connecting

    Posted Fri October 27, 2023 09:13 AM

    Kevin, 

    Instead of using the environment variables, why can't they upload properties from an ini file and set the property on the queue manager

    from memory

    props.Add(WMQC.CCDT_URL, file:///pathtoJSonccdt.json)

    where the Path and filename for the JSON ccdt would be retrieved from the application properties...



    ------------------------------
    Francois Brandelik
    ------------------------------



  • 7.  RE: CCDT JSON and Client Not Connecting

    Posted Fri October 27, 2023 10:43 AM

    Thanks for the suggestion. It's a good work around, but I don't see that property - WMQC.CCDT_URL. I did update the 'mqclient.ini' on the client side to include the path and JSON, and that also seems a good work around. Have not see the error since I added this section. Although, timing wise, it could be just a coincidence as this problem just goes away (my favorite kind). 

    CHANNELS:
        ChannelDefinitionDirectory=PATH TO JSON
        ChannelDefinitionFile=JSON FILENAME



    ------------------------------
    Kevin Cobb
    ------------------------------



  • 8.  RE: CCDT JSON and Client Not Connecting

    Posted Fri October 27, 2023 11:12 AM

    I said it was from memory,

    Look for WMQConstants.WMQ_CCDTURL



    ------------------------------
    Francois Brandelik
    ------------------------------