I’d like to write some code to monitor the queue size on Websphere 7 MQ.
This is the code I’ve come up with
MQEnvironment.hostname = "10.21.1.19";
MQEnvironment.port = 1414;
MQEnvironment.channel = "SYSTEM.CDEF.SVRCONN";
MQEnvironment.properties.put(MQC.TRANSPORT_PROPERTY, MQC.TRANSPORT_MQSERIES);
MQQueueManager qMgr = new MQQueueManager("MYQMGR");
MQQueue destQueue = qMgr.accessQueue("PUBLISH", MQC.MQOO_INQUIRE);
System.out.println(destQueue.getCurrentDepth());
destQueue.close();
qMgr.disconnect();
How do I know what the “Channel” is?
How do I know what the queue manager name is that I pass into MQQueueManager?
Or is there another API that I should look at?
I need it work with WRS 7 SIB and MQ.
Thanks
Jeff Porter
I used the jars from WS 7.0.1.1
com.ibm.mq.jar
com.ibm.mq.jmqi.jar
com.ibm.mq.jmqi.system.jar
com.ibm.mq.commonservices.jar
com.ibm.mq.headers..jar
com.ibm.mq.jmqi.remote.jar
I got the Queue Manager name and the Channel name from “IBM Webshpere MQ Explorer” (Client Connection node in the tree)
Hope this helps someone else out!