ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » IBM MQ Java / JMS » INQUIRE_Q_STATUS PCF command not working & crashing

Post new topic  Reply to topic
 INQUIRE_Q_STATUS PCF command not working & crashing « View previous topic :: View next topic » 
Author Message
aq
PostPosted: Tue Aug 09, 2005 1:03 am    Post subject: INQUIRE_Q_STATUS PCF command not working & crashing Reply with quote

Apprentice

Joined: 20 Dec 2001
Posts: 47

Hi,

I would like to get list of process id's, what server connection channels they are using and from what ip they are connected to queue, by using the INQUIRE_Q_STATUS PCF command in Java.

The problem is that either the command returns single PCFMessage as answer to request, where all .getParameterValue() -method calls return null, or in some cases after few call's it returns "com.ibm.mq.MQException: MQJE001: Completion Code 2, Reason 2033" and crashes the amqpcsea process in WMQ queue manager (produces FDC file, WMQ have to be restarted after this so that it will work again).

I found similiar problem from the post "Having problems with INQUIRE_Q_STATUS using PCFMessageAgent (http://www.mqseries.net/phpBB2/viewtopic.php?t=11434)", but unfortunately that didn't solve my problem (example code in that post works OK altought).

The WMQ version is 530.10 CSD10 on Windows.

I attached the test code that I can use to re-produce the problem:
Code:
   public static void main(String[] args) {
      PCFMessageAgent agent = null;

      try {

         // Create INQUIRE_Q_STATUS PCF message
         PCFMessage inquireQueueStatus = new PCFMessage(
               CMQCFC.MQCMD_INQUIRE_Q_STATUS);
         inquireQueueStatus.addParameter(CMQC.MQCA_Q_NAME, "TEST.LQ");
         inquireQueueStatus.addParameter(CMQCFC.MQIACF_Q_STATUS_TYPE,
               CMQCFC.MQIACF_Q_HANDLE);

         // Connect to qmgr
         agent = new PCFMessageAgent();
         agent.connect("BROKER_QM");
         
         // Send the INQUIRE_Q_STATUS PCF request
         PCFMessage response[] = agent.send(inquireQueueStatus);
         
         // Print the INQUIRE_Q_STATUS PCF response(s)
         for (int i = 0; i < response.length; i++) {
            String queueName = (String) response[i]
                  .getParameterValue(CMQC.MQCA_Q_NAME);
            String channelName = (String) response[i]
                  .getParameterValue(CMQCFC.MQCACH_CHANNEL_NAME);
            String connectionName = (String) response[i]
                  .getParameterValue(CMQCFC.MQCACH_CONNECTION_NAME);
            System.out.println(queueName + ", " + channelName + ", "
                  + connectionName);
         }

      } catch (Exception e) {
         e.printStackTrace();
      } finally {
         if (agent != null) {
            try {
               agent.disconnect();
            } catch (MQException ignored) {
            }
         }
      }

   }


I appreciate your help,
aq
Back to top
View user's profile Send private message
Nigelg
PostPosted: Tue Aug 09, 2005 1:41 am    Post subject: Reply with quote

Grand Master

Joined: 02 Aug 2004
Posts: 1046

You might need APAR IY69886 qv.
Back to top
View user's profile Send private message
aq
PostPosted: Tue Aug 09, 2005 2:36 am    Post subject: Reply with quote

Apprentice

Joined: 20 Dec 2001
Posts: 47

That was good tip.

Adding the QStatusAttrs -code line fixed the problem,
Code:
// Fixed & working code
inquireQueueStatus.addParameter(CMQC.MQCA_Q_NAME, "TEST.LQ");
inquireQueueStatus.addParameter(CMQCFC.MQIACF_Q_STATUS_TYPE,
               CMQCFC.MQIACF_Q_HANDLE);
inquireQueueStatus.addParameter(CMQCFC.MQIACF_Q_ATTRS,
               new int[] { CMQCFC.MQIACF_ALL });


It seems that also the parameter order matters, I first added the MQIACF_Q_ATTRS before the MQIACF_Q_STATUS_TYPE, and it then returned the QName, but not the ChannelName or ConnName(returned only null). After I corrected order it now returns also the ChannelName and ConnName.

Thanks Nigel for your help !
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » IBM MQ Java / JMS » INQUIRE_Q_STATUS PCF command not working & crashing
Jump to:  



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.