MQ

 View Only
  • 1.  Auto Connect to Queuemanager

    Posted Fri April 05, 2024 01:12 PM

    The ERP (Universe) system has multiple MQAPI based client programs needs to stop and start whenever it disconnect or queuemanager fails over to other node in RDQM Cluster.  Is it possible to reconnet to automatically or How can I configure the client side to get reconnected to queuemanager when something like happens.

    Thank you.

    Rajesh



    ------------------------------
    RAJESH VERMA
    ------------------------------


  • 2.  RE: Auto Connect to Queuemanager

    Posted Fri April 05, 2024 04:21 PM

    Hello,

    Yes, it is possible for an MQ client to automatically reconnect to the Queue Manager after a switchover.
    There are a number of possibilities:
    https://www.ibm.com/docs/en/ibm-mq/9.3?topic=restart-automatic-client-reconnection

    You would need to know how MQ clients are configured on the ERP side:
    - via the MQSERVER environment variable
    - via a CCDT
    - via an MQCONNX in the code
    - via an mqclient.ini
    ...



    ------------------------------
    Luc-Michel Demey
    DEMEY CONSULTING
    lmd@demey-consulting.fr
    #IBMChampion
    ------------------------------



  • 3.  RE: Auto Connect to Queuemanager

    Posted Wed April 10, 2024 11:04 AM

    Hi Luc, 

    Thank you very much for your update. I am trying to find the information from Development Team and will get back to you on this.

    Regards,
    Rajesh



    ------------------------------
    RAJESH VERMA
    ------------------------------



  • 4.  RE: Auto Connect to Queuemanager

    Posted Fri May 10, 2024 08:17 PM

    Hi Luc,

    The development team use mqconnect while connecting to queuemanager using MQ API, a part of the application component code starts like this;
    =======================================================================

    :


    $INCLUDE INSERTS STD.FILES
    $INCLUDE UNIVERSE.INCLUDE U2MQI.H
    $INCLUDE INSERTS MQ.MQI.INITS

    :

    :

    **********************
    INITIALIZE.MQ.SESSION:
    **********************

    CONNECT.STATUS = MQ.CONNECT(QUEUE.MANAGER.HANDLE, QUEUE.MANAGER.NAME)

    IF CONNECT.STATUS = 0 THEN
    CONNECTED = @TRUE
    END ELSE
    EXIT.PROGRAM = @TRUE
    END

    RETURN

    :

    :

    ============================

    This indicates they are using MQCONNX, because there is no mqclient.ini file nor exporting MQSERVER variable in their code.  Now I would like to have auto-connection to queuemanager without chainging their codes -- if its possible.

    Thank you very much in advance.

    Regards,

    Rajesh



    ------------------------------
    RAJESH VERMA
    ------------------------------



  • 5.  RE: Auto Connect to Queuemanager

    Posted Fri May 10, 2024 10:29 PM

    Hi Rajesh,

    Luc was asking how clients were configured so that we could advise where to also set the automatic client reconnect so that it would be in the same place.

    You have shown us code that does not set the hostname or any other client configuration, suggesting that you ARE using either MQSERVER or CCDT or mqclient.ini file. It shows that you are NOT using MQCONNX since the only attribute passed to the connect verb is the queue manager name. One would not expect to see the environment variables in the code. The whole point is that it can be changed without changing the code.

    So, let's try asking the question again in a different way. Could you tell us where the configuration of hostname and port number for the queue manager are set in this environment?

    Cheers,
    Morag



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



  • 6.  RE: Auto Connect to Queuemanager

    Posted Wed May 15, 2024 11:00 AM

    Hi Morag,

    I am sorry you are right.  I got a chance to speak with one of the Architect who is involved in every step of implementation and administration of this application since beginning.  He mentioned that a variable for MQServer with hostname and port being exported in profile file of application.  

    Thank you very much.

    Regards,

    Rajesh



    ------------------------------
    RAJESH VERMA
    ------------------------------



  • 7.  RE: Auto Connect to Queuemanager

    Posted Thu May 16, 2024 08:27 PM

    Hi Rajesh,

    That's great - now we know how the client configuration is done we can advise further.

    While many of the client attributes can be set using environment variables or using mqclient.ini, automatic reconnect setting can only be provide external to the application using the mqclient.ini file (in other words there is no environment variable equivalent). For anyone reading this in the future, you can set client reconnect in the client code if you are using MQCONNX as well, and you can set it in a CCDT, but these don't apply to this specific application.

    You should create a file called mqclient.ini with contents like the following:-

    CHANNELS:
    DefRecon=YES

    Then either place it in the current working directory of the application or set the environment variable MQCLNTCF to refer to its location. See Location of the client configuration file

    Keep us posted on how you get on.

    Cheers,
    Morag



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



  • 8.  RE: Auto Connect to Queuemanager

    Posted Tue June 04, 2024 09:43 AM

    Hi Morag,

    Thank you very much for your prompt response, I am now waiting for the maintenance window from Dev Team and plan to implement this for Dev instance hopefully in this month sometime.  I will definitely update you after implementing this.

    Regards,

    Rajesh



    ------------------------------
    RAJESH VERMA
    ------------------------------