MQ

 View Only
  • 1.  Websphere MQ :: MQ queue manager closed channel immediately during connect error

    Posted Wed May 17, 2023 02:27 AM

    We have a Java application to read and write messages to Queue

    when we run the get or  put operation to read MQ messages or write to MQ multiple times continuously,  at some point get or put operation will fail with the below error 

    The test connection for ibm_mq_appauth failed. [SDK_APP_COM_20000] error [error [MQJE001: An MQException occurred: Completion Code 2, Reason 2009 MQJE016: MQ queue manager closed channel immediately during connect Closure reason = 2009]]

    one of the reasons can be the connection channel status exceeds 100

    https://www.ibm.com/docs/en/ibm-mq/8.0?topic=function-server-connection-channel-limits

    once the connection count decreases the get or put operation works fine

    How can we increase the connection count? what is the solution available to resolve this issue?

    now the only workaround that we are following is, to wait till the connection count decreases or restart Queue Manager (with this we lose the data)








    ------------------------------
    Ranjitha YM
    ------------------------------


  • 2.  RE: Websphere MQ :: MQ queue manager closed channel immediately during connect error

    Posted Wed May 17, 2023 04:36 AM

    Hi,

    You need to increase MaxChannels in your qm.ini 

    See, https://www.ibm.com/docs/en/ibm-mq/9.3?topic=qmini-channels-stanza-file



    ------------------------------
    Regards,

    Martin Evans
    IBM MQ Technical Product Manager
    ------------------------------



  • 3.  RE: Websphere MQ :: MQ queue manager closed channel immediately during connect error

    Posted Wed May 17, 2023 07:08 AM

    What is the maximum connection count a channel can support



    ------------------------------
    Ranjitha YM
    ------------------------------



  • 4.  RE: Websphere MQ :: MQ queue manager closed channel immediately during connect error

    Posted Thu May 18, 2023 09:30 PM

    Hi Ranjitha,

    From the context of the question in this thread, I assume you are asking "What is the maximum number I can set MaxChannels in qm.ini to?" I will try to answer that question.

    The maximum number of channels that a queue manager can run is dependant on the resources available on the machine it is running, number of file handles (for sockets), amount of memory and such things. IBM MQ Performance reports have over the years detailed how much of these resources channels would use and thus what the maximum you might set this number to. As a rule of thumb, 10,000 channels seemed to be an appropriate high water mark for this number.

    When thinking about what value you want to set MaxChannels to on your queue manager, it should reflect the number you NEED (bearing in mind the above high water mark) with a little bit extra for contingency. Your might find this post a useful read when trying to figure out what your value needs to be.

    If instead you are asking "What is the maximum number of concurrent connections that can use a single channel between a client process and the queue manager" or some other question, please do reply to let us know.

    Cheers,
    Morag



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



  • 5.  RE: Websphere MQ :: MQ queue manager closed channel immediately during connect error

    Posted Thu May 18, 2023 04:33 PM

    Here's my answer that I posted to your same question on StackOverflow.

    RY> when we run the get or put operation to read MQ messages or write to MQ multiple times continuously, at some point get or put operation will fail with the below error

    Interesting comment. My first thought is that you have some poor coding in your application.

    (1) Is your application connecting and staying connected while it performs gets and puts throughout the day or days?

    (2) Or is your application connecting, doing some gets and puts but then returning, or the thread ends but never disconnects from the queue manager?

    Because it sounds like your application is doing #2. This would explain why your channel connection count keeps rising. It is bad coding practice to not disconnect from the queue manager when the application is done whatever it was doing. The MQ client library will NOT automatically perform the disconnection for your application.

    Bottomline is that even if you increase the channel max connection limit from 100 to 300, your poorly coded application will eventually use all 300 connections and then have the same problem. Therefore, you need to fix the code and ensure it disconnects from the queue manager when done.



    ------------------------------
    Roger Lacroix
    CTO
    Capitalware Inc.
    London ON Canada
    https://capitalware.com
    ------------------------------