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 » Help with PCF MQCMD_INQUIRE_CONNECTION command

Post new topic  Reply to topic
 Help with PCF MQCMD_INQUIRE_CONNECTION command « View previous topic :: View next topic » 
Author Message
CoreySanders
PostPosted: Tue May 27, 2008 9:44 am    Post subject: Help with PCF MQCMD_INQUIRE_CONNECTION command Reply with quote

Novice

Joined: 20 Feb 2008
Posts: 11

I am trying to run the equivalent of the MQSC "dis conn(*)" from a Java PCF client, but I am running into trouble. The agent send command is throwing an MQException with RC 3015 which is MQRCCF_CFST_PARM_ID_ERROR. This error implies that the name of one of the the parameters that I am passing is invalid. From my reading of the docs, that is not the case. The does state that this command requires one of two input parameters. Either I specify generic connection id with no value or connection id with a specific value. I have tried both with no luck.

There is some indication that the PCF APIs will throw this error if the user account I am running under does not have object permissions to an object that is being queried as part of the command. I am running as the mqm user. I feel like I should have permissions to everything. It works fine if I run 'echo "dis conn(*)" | runmqsc MY.QUEUE.MANAGER.'

Any help/suggestions would be appreciated.

[mqm@qcudubvcsmqm041 test]$ uname -a
SunOS server 5.9 Generic_122300-21 sun4us sparc FJSV,GPUZC-M

[mqm@server test]$ dspmqver
Name: WebSphere MQ
Version: 6.0.2.3
CMVC level: p600-203-080204
BuildType: IKAP - (Production)

[mqm@server test]$ cat src/util/TestInquireConnection.java
package util;

import com.ibm.mq.*;
import com.ibm.mq.pcf.*;

/** Sample program to test using PCF to run dis conn(*)
* @see http://publib.boulder.ibm.com/infocenter/wmqv6/v6r0/topic/com.ibm.mq.csqzac.doc/pc12550_.htm
*/
public class TestInquireConnection
{
public static void main(String [] args)
throws Exception
{
MQException.log = null;

PCFMessageAgent agent = new PCFMessageAgent("localhost", 1414, "CHANNEL1");
try {
PCFMessage request = new PCFMessage(CMQCFC.MQCMD_INQUIRE_CONNECTION);
request.addParameter(CMQCFC.MQBACF_GENERIC_CONNECTION_ID, "");
//request.addParameter(CMQCFC.MQBACF_CONNECTION_ID, "*");

PCFMessage [] responses = agent.send(request);

for(int i=0; i<responses.length; i++)
{
if( i == 0 ) System.out.println("CONNAME,UOWLOGDA,UOWLOGTI");

PCFMessage response = responses[i];
System.out.println(
response.getParameterValue(CMQCFC.MQCACH_CONNECTION_NAME) + "," +
response.getParameterValue(CMQCFC.MQCACF_UOW_LOG_START_DATE) + "," +
response.getParameterValue(CMQCFC.MQCACF_UOW_LOG_START_TIME)
);
}

} catch(MQException mqe)
{
System.err.println (PCFConstants.lookupReasonCode (mqe.reasonCode));
mqe.printStackTrace(System.err);
} finally {
agent.disconnect();
}
}
}
Back to top
View user's profile Send private message
CoreySanders
PostPosted: Tue May 27, 2008 12:19 pm    Post subject: RTFM Reply with quote

Novice

Joined: 20 Feb 2008
Posts: 11

As with most things this just ended up being an RTFM case. The connection id parameters are clearly marked as MQFSB structures, meaning I should pass a byte array and not a string. Below are the relevant code changes. Sorry if I wasted anyone's time on this.

request.addParameter(CMQCFC.MQBACF_GENERIC_CONNECTION_ID, new byte[0]);
request.addParameter(CMQCFC.MQIACF_CONNECTION_ATTRS, new int[] { CMQCFC.MQIACF_ALL });
request.addFilterParameter(CMQCFC.MQCACF_UOW_LOG_START_DATE, CMQCFC.MQCFOP_NOT_EQUAL, " ");
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 » Help with PCF MQCMD_INQUIRE_CONNECTION command
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.