Hi,
 

Required below info:

1.Can I get the OS and MQ&CSD Versions details??

2.Post the put and get message part application code??

 

This could be APAR IY31882 issues ...which is fixed in MQ 5.2 CSD6.

 

Regards
AS
 
 
-----Original Message-----
From: MQSeries List [mailto:[EMAIL PROTECTED]On Behalf Of Srinivas Amarnadh
Sent: Wednesday, August 04, 2004 10:52 AM
To: [EMAIL PROTECTED]
Subject: problem while reading MQ messages

Hi

I am trying to do two thing

#1

One thread is reading a Queue continuously. I am checking whether the messages are available in the queue or not by using a method currentDepth(). If messages are available reading the messages else do nothing.

Here is the code used to open queue and get message.

MQQueue aMQLocalQueue       =null;

      int iOpenOptionsLocal;

     

      public MQReaderThread()

      {

                                    iOpenOptionsLocal =   MQC.MQOO_INPUT_AS_Q_DEF | MQC.MQOO_INQUIRE ;

      }

     

      public void _openConnection()

      {

            try

            {

                        System.out.println("Connecting...");

                        MQEnvironment.hostname=strHostname;

                        MQEnvironment.port=1414;

                        MQEnvironment.channel=strChannel;

                        MQEnvironment.properties.put(MQC.TRANSPORT_PROPERTY,MQC.TRANSPORT_MQSERIES);

                        aMQManager=new MQQueueManager(strQManager);

                        aMQLocalQueue=aMQManager.accessQueue(strLocalQueue,      iOpenOptionsLocal,null,null,null); 

                        System.out.println("Connection Opened.");

           

            }

            catch (Exception e)

            {

                  e.printStackTrace();

            }

           

      }

#2

While running the first program I am executing the second program which put the messages on the same queue.

Here is the code to put the message.

int iOpenOptionsLocal;

  public MYMQTest()

  {

   iOpenOptionsLocal= MQC.MQOO_INPUT_AS_Q_DEF | MQC.MQOO_OUTPUT ;

  }

  public void openConnection()

  {

 

      try{

        MQEnvironment.hostname      =strHostname;

        MQEnvironment.port          =1414;

        MQEnvironment.channel       =strChannel;

        MQEnvironment.properties.put(MQC.TRANSPORT_PROPERTY,MQC.TRANSPORT_MQSERIES);

        aMqm=new MQQueueManager(strQManager);

 

        System.out.println("Inside Connection Opened.");

        aMqlqueue=aMqm.accessQueue(strLocalQueue,iOpenOptionsLocal,null,null,null);

       // aMqlqueue=aMqm.accessQueue(strQueue,iOpenOptionsLocal,null,null,null);

        System.out.println("Connection Opened.");

        }

        catch(Exception e)

        {

          e.printStackTrace();

        }

  }

 

 

 

Problem :

 

I am encountering problem while execution of the program #1.

 I am doing the following thing.

      1) start the #1 program when there are no messages on the queue.

      2) #1 program prints “no messages found in queue”.

      3) I am executing #2 program which puts 5 messages on the queue.

      4) then program #1 reads the messages from the queue.

  When I execute step 3 twice the program #1 giving me mqexception with 2039.

 

I tried with different open options, but I couldn't get the solutions.

 

I am getting a MQException with the id 2039.

 

 

 

 

 

Can any one clearly explain what could be the problem?

 

 

 

Thanks and regards

 

M.Srinivas Amarnadh

iflex Solutions Ltd.,

Millenium Towers,

Kundalahalli Main Road,

Bangalore - 560 037.

Phone : 57596000 , 22086000

Extn - 6616

 

 

 

M.Srinivas Amarnadh

iflex Solutions Ltd.,

Millenium Towers,

Kundalahalli Main Road,

Bangalore - 560 037.

Phone : 57596000 , 22086000

Extn - 6616

 

**************************************************************************

This email (including any attachments) is intended for the sole use of the intended recipient/s and may contain material that is CONFIDENTIAL AND PRIVATE COMPANY INFORMATION. Any review or reliance by others or copying or distribution or forwarding of any or all of the contents in this message is STRICTLY PROHIBITED. If you are not the intended recipient, please contact the sender by email and delete all copies; your cooperation in this regard is appreciated.

**************************************************************************

Reply via email to