|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
Java PCF MQCMD_INQUIRE_Q_MGR Attributes |
« View previous topic :: View next topic » |
Author |
Message
|
KxK3 |
Posted: Thu Mar 26, 2009 7:53 am Post subject: Java PCF MQCMD_INQUIRE_Q_MGR Attributes |
|
|
 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 |
|
 |
KxK3 |
Posted: Fri Mar 27, 2009 4:40 am Post subject: |
|
|
 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 |
|
 |
|
|
 |
|
Page 1 of 1 |
|
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
|
|
|
|