Topic
5 replies Latest Post - ‏2013-07-10T23:22:41Z by GBaddeley
Balagangadhar
Balagangadhar
2 Posts
ACCEPTED ANSWER

Pinned topic Reading messages from a queue

‏2013-07-08T10:37:03Z |

Hi,

I want to read thousands of messages from a queue using java client, but I am getting this error ::::::com.ibm.mq.MQException: MQJE001: An MQException occurred: Completion Code 2, Reason 2009 MQJE016: MQ queue manager closed channel immediately during connect.

Can you please suggest me the possible ways of reading thousands of messages in a single time. Right now I am able to read upto 90 messages from a queue using java client.

 

Thanks....

  • GBaddeley
    GBaddeley
    185 Posts
    ACCEPTED ANSWER

    Re: Reading messages from a queue

    ‏2013-07-08T23:28:47Z  in response to Balagangadhar

    You can read millions of messages from a queue using the java client without any problems at all. Reason code 2009 means that the transport layer failed unexpectedly between the MQ client and the MQ queue manager. Look at a recent thread on this forum for discussion about 2009 -> https://www.ibm.com/developerworks/community/forums/html/topic?id=0f960990-e404-47b9-b7d7-fc9147d91a96&ps=25

    HTH, G.

    • Balagangadhar
      Balagangadhar
      2 Posts
      ACCEPTED ANSWER

      Re: Reading messages from a queue

      ‏2013-07-09T16:26:50Z  in response to GBaddeley

      Hi,

      Thanks for your valuable time and reply.

      Can you please provide me the java client code sample with out getting the 2009 error code.

       

      Thanks & Regards,

      Bala.

      • fjbuzz
        fjbuzz
        4 Posts
        ACCEPTED ANSWER

        Re: Reading messages from a queue

        ‏2013-07-09T20:27:38Z  in response to Balagangadhar

        You may want to see the following information about Automatic Client connection feature added to MQ V7.

        https://ibm.biz/BdxTQE

        As noted on the above infocenter java classes are not supported.

      • GBaddeley
        GBaddeley
        185 Posts
        ACCEPTED ANSWER

        Re: Reading messages from a queue

        ‏2013-07-09T23:11:37Z  in response to Balagangadhar

        >Can you please provide me the java client code sample with out getting the 2009 error code.

        There is no known MQ code in the universe that can completely avoid the possibility of receiving a 2009 reason code.

        I suggest that you read again the discussion thread that I referred to.  2009 indicates a problem that is beyond the control of MQ and your code.  Go and fix it !

  • GBaddeley
    GBaddeley
    185 Posts
    ACCEPTED ANSWER

    Re: Reading messages from a queue

    ‏2013-07-10T23:22:41Z  in response to Balagangadhar

    90 is close to the default 100 maximum channel limit in a queue manager. Can you check that your java app is not making a new connection to the queue manager for each message, and then not disconnecting ?  (Use MQ Explorer to display status of channels, or use DISPLAY CHSTATUS(*) CURRENT command in runmqsc)

    HTH, G.