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 API Support » Java PCF MQCMD_INQUIRE_Q_MGR Attributes

Post new topic  Reply to topic
 Java PCF MQCMD_INQUIRE_Q_MGR Attributes « View previous topic :: View next topic » 
Author Message
KxK3
PostPosted: Thu Mar 26, 2009 7:53 am    Post subject: Java PCF MQCMD_INQUIRE_Q_MGR Attributes Reply with quote

Newbie

Joined: 01 Apr 2008
Posts: 6

I was wondering if someone could help me with this. I'm trying to inquire the queue manager attributes of a remote queue manager. I think I just have the parameter syntax wrong

Code:
        try {
            PCFMessageAgent agent = new PCFMessageAgent(ipaddr, 1414, "SYSTEM.ADMIN.SVRCONN");

            PCFMessage request = new PCFMessage(CMQCFC.MQCMD_INQUIRE_Q_MGR);
            request.addParameter(CMQCFC.MQIACF_Q_MGR_ATTRS, CMQCFC.MQIACF_ALL);
            PCFMessage []   responses = agent.send (request);

            String names = responses[0].getStringParameterValue(CMQCFC.MQIACF_ALL);
            System.out.println(names);

        }
        catch (PCFException pcfe)
        { System.err.println ("PCF error: " + pcfe); }
        catch (MQException mqe)
        { System.err.println (mqe); }
        catch (IOException ioe)
        { System.err.println (ioe); }


MQJE001: Completion Code '2', Reason '3097'.
PCF error: com.ibm.mq.pcf.PCFException: MQJE001: Completion Code '2', Reason '3097'.

Thanks!
Back to top
View user's profile Send private message
KxK3
PostPosted: Fri Mar 27, 2009 4:40 am    Post subject: Reply with quote

Newbie

Joined: 01 Apr 2008
Posts: 6

figured it out
i used the example found in C:\Program Files\IBM\WebSphere MQ\tools\pcf\samples\PCF_WalkThroughQueueManagerAttributes.java

should've looked at that first lol.

Code:
        try {
            PCFMessageAgent agent = new PCFMessageAgent(ipaddr, 1414, "SYSTEM.ADMIN.SVRCONN");

            int[] pcfParmAttrs = {com.ibm.mq.constants.CMQCFC.MQIACF_ALL};
            PCFParameter[] pcfParameters = {new MQCFIL(com.ibm.mq.constants.CMQCFC.MQIACF_Q_MGR_ATTRS, pcfParmAttrs)};
            MQMessage [] responses = agent.send(com.ibm.mq.constants.CMQCFC.MQCMD_INQUIRE_Q_MGR, pcfParameters);
            MQCFH mqCFH = new MQCFH(responses[0]);
            PCFParameter pcfParam;

                if (mqCFH.getReason() == 0) {
                    for (int index = 0; index < mqCFH.getParameterCount(); index++) {
                                // Walk through the returned attributes.
                            pcfParam = PCFParameter.nextParameter(responses[0]);
                                    System.out.println(pcfParam.getParameterName());
                                    System.out.println(pcfParam.getValue());
                    }
                }
        }
        catch (PCFException pcfe)
        { System.err.println ("PCF error: " + pcfe); }
        catch (MQException mqe)
        { System.err.println (mqe); }
        catch (IOException ioe)
        { System.err.println (ioe); }
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 API Support » Java PCF MQCMD_INQUIRE_Q_MGR Attributes
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.