|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
Help with PCF MQCMD_INQUIRE_CONNECTION command |
« View previous topic :: View next topic » |
Author |
Message
|
CoreySanders |
Posted: Tue May 27, 2008 9:44 am Post subject: Help with PCF MQCMD_INQUIRE_CONNECTION command |
|
|
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 |
|
 |
CoreySanders |
Posted: Tue May 27, 2008 12:19 pm Post subject: RTFM |
|
|
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 |
|
 |
|
|
 |
|
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
|
|
|
|