|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
How to read (queue) Cluster Priority using PCF |
« View previous topic :: View next topic » |
Author |
Message
|
sebastia |
Posted: Sat Feb 15, 2014 5:47 am Post subject: How to read (queue) Cluster Priority using PCF |
|
|
 Grand Master
Joined: 07 Oct 2004 Posts: 1003
|
Hi.
Now that I know how to "change" the Cluster Priority (thanks, Jeff), I would like to READ IT first, so I can increment it or decrement it, instead of fixing a value.
My code runa fine :
Code: |
import java.io.IOException ;
import com.ibm.mq.MQException ;
import com.ibm.mq.constants.MQConstants ;
import com.ibm.mq.pcf.* ; // PCFMessagAgent
public class jeff_getQ {
public static void main( String[] args ) {
try {
System.out.println ( ">>> MQ Get Queue parameter using PCF by Jeff, v 20140215a") ;
PCFMessageAgent agent = new PCFMessageAgent( "localhost", 2415, "SAG.SVRCONN" );
System.out.println ( "+++ Connected" ) ;
// Build the request
PCFMessage request = new PCFMessage ( MQConstants.MQCMD_INQUIRE_Q ) ; // inquiry
request.addParameter ( MQConstants.MQCA_Q_NAME, "QLIN" ) ; // queue name
request.addParameter ( MQConstants.MQIA_Q_TYPE, MQConstants.MQQT_LOCAL ) ; // q type = local queue
request.addParameter ( MQConstants.MQIACF_CLUSTER_INFO, MQConstants.MQIA_CLWL_Q_PRIORITY ) ; // get actual priority
PCFMessage[] responses = agent.send ( request ) ;
System.out.println ( "+++ Received reply, lng ("+ responses.length + ")." ) ;
for ( PCFMessage pcfMessage : responses ) {
System.out.println ( pcfMessage ) ;
} ; // for
// Disconnect
System.out.println ( ">>> Disconnecting... " ) ;
agent.disconnect () ;
} // try
catch ( MQException mqe ) {
System.err.println ( mqe ) ;
}
catch ( IOException ioe ) {
System.err.println ( ioe ) ;
}
} ; // main()
} ; // |
But my sirprise is that in the response message I get not only the Cluster Priority, but all the cluster algoritm values.
Here it is :
Code: |
>>> MQ Get Queue parameter using PCF by Jeff, v 20140215a
+++ Connected
+++ Received reply, lng (1).
PCFMessage:
MQCFH (com.ibm.mq.headers.internal.store.ByteStore [encoding: 0x00000001, ccsid: 1208, size: 36] @1565058518)
MQLONG Type: 2 (0x00000002)
MQLONG StrucLength: 36 (0x00000024)
MQLONG Version: 1 (0x00000001)
MQLONG Command: 13 (0x0000000d)
MQLONG MsgSeqNumber: 1 (0x00000001)
MQLONG Control: 1 (0x00000001)
MQLONG CompCode: 0 (0x00000000)
MQLONG Reason: 0 (0x00000000)
MQLONG ParameterCount: 56 (0x00000038)
MQCFST (com.ibm.mq.headers.internal.ReflectingStore [encoding: 0x00000001, ccsid: 1208])
MQLONG Type: 4 (0x00000004)
MQLONG StrucLength: 68 (0x00000044)
MQLONG Parameter: 2016 (MQCA_Q_NAME)
MQLONG CodedCharSetId: 1208 (0x000004b8)
MQLONG StringLength: 48 (0x00000030)
MQCHAR[] String: "QLIN "
MQCFIN (com.ibm.mq.headers.internal.ReflectingStore [encoding: 0x00000001, ccsid: 1208])
MQLONG Type: 3 (0x00000003)
MQLONG StrucLength: 16 (0x00000010)
MQLONG Parameter: 20 (MQIA_Q_TYPE)
MQLONG Value: 1 (0x00000001)
MQCFIN (com.ibm.mq.headers.internal.ReflectingStore [encoding: 0x00000001, ccsid: 1208])
MQLONG Type: 3 (0x00000003)
MQLONG StrucLength: 16 (0x00000010)
MQLONG Parameter: 134 (MQIA_ACCOUNTING_Q)
MQLONG Value: -3 (0xfffffffd)
MQCFST (com.ibm.mq.headers.internal.ReflectingStore [encoding: 0x00000001, ccsid: 1208])
MQLONG Type: 4 (0x00000004)
MQLONG StrucLength: 32 (0x00000020)
MQLONG Parameter: 2027 (MQCA_ALTERATION_DATE)
MQLONG CodedCharSetId: 1208 (0x000004b8)
MQLONG StringLength: 12 (0x0000000c)
MQCHAR[] String: "2014-02-15 "
MQCFST (com.ibm.mq.headers.internal.ReflectingStore [encoding: 0x00000001, ccsid: 1208])
MQLONG Type: 4 (0x00000004)
MQLONG StrucLength: 28 (0x0000001c)
MQLONG Parameter: 2028 (MQCA_ALTERATION_TIME)
MQLONG CodedCharSetId: 1208 (0x000004b8)
MQLONG StringLength: 8 (0x00000008)
MQCHAR[] String: "13.18.21"
MQCFST (com.ibm.mq.headers.internal.ReflectingStore [encoding: 0x00000001, ccsid: 1208])
MQLONG Type: 4 (0x00000004)
MQLONG StrucLength: 68 (0x00000044)
MQLONG Parameter: 2019 (MQCA_BACKOUT_REQ_Q_NAME)
MQLONG CodedCharSetId: 1208 (0x000004b8)
MQLONG StringLength: 48 (0x00000030)
MQCHAR[] String: " "
MQCFIN (com.ibm.mq.headers.internal.ReflectingStore [encoding: 0x00000001, ccsid: 1208])
MQLONG Type: 3 (0x00000003)
MQLONG StrucLength: 16 (0x00000010)
MQLONG Parameter: 22 (MQIA_BACKOUT_THRESHOLD)
MQLONG Value: 0 (0x00000000)
MQCFST (com.ibm.mq.headers.internal.ReflectingStore [encoding: 0x00000001, ccsid: 1208])
MQLONG Type: 4 (0x00000004)
MQLONG StrucLength: 68 (0x00000044)
MQLONG Parameter: 2030 (MQCA_CLUSTER_NAMELIST)
MQLONG CodedCharSetId: 1208 (0x000004b8)
MQLONG StringLength: 48 (0x00000030)
MQCHAR[] String: " "
MQCFST (com.ibm.mq.headers.internal.ReflectingStore [encoding: 0x00000001, ccsid: 1208])
MQLONG Type: 4 (0x00000004)
MQLONG StrucLength: 68 (0x00000044)
MQLONG Parameter: 2029 (MQCA_CLUSTER_NAME)
MQLONG CodedCharSetId: 1208 (0x000004b8)
MQLONG StringLength: 48 (0x00000030)
MQCHAR[] String: " "
MQCFST (com.ibm.mq.headers.internal.ReflectingStore [encoding: 0x00000001, ccsid: 1208])
MQLONG Type: 4 (0x00000004)
MQLONG StrucLength: 68 (0x00000044)
MQLONG Parameter: 2124 (MQCA_CLUS_CHL_NAME/MQCA_LAST_USED)
MQLONG CodedCharSetId: 1208 (0x000004b8)
MQLONG StringLength: 48 (0x00000030)
MQCHAR[] String: " "
MQCFIN (com.ibm.mq.headers.internal.ReflectingStore [encoding: 0x00000001, ccsid: 1208])
MQLONG Type: 3 (0x00000003)
MQLONG StrucLength: 16 (0x00000010)
MQLONG Parameter: 96 (MQIA_CLWL_Q_PRIORITY)
MQLONG Value: 5 (0x00000005)
MQCFIN (com.ibm.mq.headers.internal.ReflectingStore [encoding: 0x00000001, ccsid: 1208])
MQLONG Type: 3 (0x00000003)
MQLONG StrucLength: 16 (0x00000010)
MQLONG Parameter: 95 (MQIA_CLWL_Q_RANK)
MQLONG Value: 0 (0x00000000)
MQCFIN (com.ibm.mq.headers.internal.ReflectingStore [encoding: 0x00000001, ccsid: 1208])
MQLONG Type: 3 (0x00000003)
MQLONG StrucLength: 16 (0x00000010)
MQLONG Parameter: 98 (MQIA_CLWL_USEQ)
MQLONG Value: -3 (0xfffffffd)
MQCFST (com.ibm.mq.headers.internal.ReflectingStore [encoding: 0x00000001, ccsid: 1208])
MQLONG Type: 4 (0x00000004)
MQLONG StrucLength: 32 (0x00000020)
MQLONG Parameter: 2004 (MQCA_CREATION_DATE)
MQLONG CodedCharSetId: 1208 (0x000004b8)
MQLONG StringLength: 12 (0x0000000c)
MQCHAR[] String: "2014-02-13 "
MQCFST (com.ibm.mq.headers.internal.ReflectingStore [encoding: 0x00000001, ccsid: 1208])
MQLONG Type: 4 (0x00000004)
MQLONG StrucLength: 28 (0x0000001c)
MQLONG Parameter: 2005 (MQCA_CREATION_TIME)
MQLONG CodedCharSetId: 1208 (0x000004b8)
MQLONG StringLength: 8 (0x00000008)
MQCHAR[] String: "16.56.13"
MQCFIN (com.ibm.mq.headers.internal.ReflectingStore [encoding: 0x00000001, ccsid: 1208])
MQLONG Type: 3 (0x00000003)
MQLONG StrucLength: 16 (0x00000010)
MQLONG Parameter: 3 (MQIA_CURRENT_Q_DEPTH)
MQLONG Value: 0 (0x00000000)
MQCFST (com.ibm.mq.headers.internal.ReflectingStore [encoding: 0x00000001, ccsid: 1208])
MQLONG Type: 4 (0x00000004)
MQLONG StrucLength: 148 (0x00000094)
MQLONG Parameter: 2119 (MQCA_CUSTOM)
MQLONG CodedCharSetId: 1208 (0x000004b8)
MQLONG StringLength: 128 (0x00000080)
MQCHAR[] String: " "
MQCFIN (com.ibm.mq.headers.internal.ReflectingStore [encoding: 0x00000001, ccsid: 1208])
MQLONG Type: 3 (0x00000003)
MQLONG StrucLength: 16 (0x00000010)
MQLONG Parameter: 61 (MQIA_DEF_BIND)
MQLONG Value: 0 (0x00000000)
MQCFIN (com.ibm.mq.headers.internal.ReflectingStore [encoding: 0x00000001, ccsid: 1208])
MQLONG Type: 3 (0x00000003)
MQLONG StrucLength: 16 (0x00000010)
MQLONG Parameter: 6 (MQIA_DEF_PRIORITY)
MQLONG Value: 0 (0x00000000)
MQCFIN (com.ibm.mq.headers.internal.ReflectingStore [encoding: 0x00000001, ccsid: 1208])
MQLONG Type: 3 (0x00000003)
MQLONG StrucLength: 16 (0x00000010)
MQLONG Parameter: 5 (MQIA_DEF_PERSISTENCE)
MQLONG Value: 0 (0x00000000)
MQCFIN (com.ibm.mq.headers.internal.ReflectingStore [encoding: 0x00000001, ccsid: 1208])
MQLONG Type: 3 (0x00000003)
MQLONG StrucLength: 16 (0x00000010)
MQLONG Parameter: 184 (MQIA_DEF_PUT_RESPONSE_TYPE)
MQLONG Value: 1 (0x00000001)
MQCFIN (com.ibm.mq.headers.internal.ReflectingStore [encoding: 0x00000001, ccsid: 1208])
MQLONG Type: 3 (0x00000003)
MQLONG StrucLength: 16 (0x00000010)
MQLONG Parameter: 188 (MQIA_DEF_READ_AHEAD)
MQLONG Value: 0 (0x00000000)
MQCFIN (com.ibm.mq.headers.internal.ReflectingStore [encoding: 0x00000001, ccsid: 1208])
MQLONG Type: 3 (0x00000003)
MQLONG StrucLength: 16 (0x00000010)
MQLONG Parameter: 4 (MQIA_DEF_INPUT_OPEN_OPTION)
MQLONG Value: 2 (0x00000002)
MQCFIN (com.ibm.mq.headers.internal.ReflectingStore [encoding: 0x00000001, ccsid: 1208])
MQLONG Type: 3 (0x00000003)
MQLONG StrucLength: 16 (0x00000010)
MQLONG Parameter: 7 (MQIA_DEFINITION_TYPE)
MQLONG Value: 1 (0x00000001)
MQCFST (com.ibm.mq.headers.internal.ReflectingStore [encoding: 0x00000001, ccsid: 1208])
MQLONG Type: 4 (0x00000004)
MQLONG StrucLength: 84 (0x00000054)
MQLONG Parameter: 2013 (MQCA_Q_DESC)
MQLONG CodedCharSetId: 1208 (0x000004b8)
MQLONG StringLength: 64 (0x00000040)
MQCHAR[] String: "no descr "
MQCFIN (com.ibm.mq.headers.internal.ReflectingStore [encoding: 0x00000001, ccsid: 1208])
MQLONG Type: 3 (0x00000003)
MQLONG StrucLength: 16 (0x00000010)
MQLONG Parameter: 34 (MQIA_DIST_LISTS)
MQLONG Value: 0 (0x00000000)
MQCFIN (com.ibm.mq.headers.internal.ReflectingStore [encoding: 0x00000001, ccsid: 1208])
MQLONG Type: 3 (0x00000003)
MQLONG StrucLength: 16 (0x00000010)
MQLONG Parameter: 9 (MQIA_INHIBIT_GET)
MQLONG Value: 0 (0x00000000)
MQCFIN (com.ibm.mq.headers.internal.ReflectingStore [encoding: 0x00000001, ccsid: 1208])
MQLONG Type: 3 (0x00000003)
MQLONG StrucLength: 16 (0x00000010)
MQLONG Parameter: 8 (MQIA_HARDEN_GET_BACKOUT)
MQLONG Value: 1 (0x00000001)
MQCFST (com.ibm.mq.headers.internal.ReflectingStore [encoding: 0x00000001, ccsid: 1208])
MQLONG Type: 4 (0x00000004)
MQLONG StrucLength: 68 (0x00000044)
MQLONG Parameter: 2008 (MQCA_INITIATION_Q_NAME)
MQLONG CodedCharSetId: 1208 (0x000004b8)
MQLONG StringLength: 48 (0x00000030)
MQCHAR[] String: " "
MQCFIN (com.ibm.mq.headers.internal.ReflectingStore [encoding: 0x00000001, ccsid: 1208])
MQLONG Type: 3 (0x00000003)
MQLONG StrucLength: 16 (0x00000010)
MQLONG Parameter: 17 (MQIA_OPEN_INPUT_COUNT)
MQLONG Value: 0 (0x00000000)
MQCFIN (com.ibm.mq.headers.internal.ReflectingStore [encoding: 0x00000001, ccsid: 1208])
MQLONG Type: 3 (0x00000003)
MQLONG StrucLength: 16 (0x00000010)
MQLONG Parameter: 15 (MQIA_MAX_Q_DEPTH)
MQLONG Value: 5000 (0x00001388)
MQCFIN (com.ibm.mq.headers.internal.ReflectingStore [encoding: 0x00000001, ccsid: 1208])
MQLONG Type: 3 (0x00000003)
MQLONG StrucLength: 16 (0x00000010)
MQLONG Parameter: 13 (MQIA_MAX_MSG_LENGTH)
MQLONG Value: 4194304 (0x00400000)
MQCFIN (com.ibm.mq.headers.internal.ReflectingStore [encoding: 0x00000001, ccsid: 1208])
MQLONG Type: 3 (0x00000003)
MQLONG StrucLength: 16 (0x00000010)
MQLONG Parameter: 123 (MQIA_MONITORING_Q)
MQLONG Value: -3 (0xfffffffd)
MQCFIN (com.ibm.mq.headers.internal.ReflectingStore [encoding: 0x00000001, ccsid: 1208])
MQLONG Type: 3 (0x00000003)
MQLONG StrucLength: 16 (0x00000010)
MQLONG Parameter: 16 (MQIA_MSG_DELIVERY_SEQUENCE)
MQLONG Value: 0 (0x00000000)
MQCFIN (com.ibm.mq.headers.internal.ReflectingStore [encoding: 0x00000001, ccsid: 1208])
MQLONG Type: 3 (0x00000003)
MQLONG StrucLength: 16 (0x00000010)
MQLONG Parameter: 24 (MQIA_TRIGGER_CONTROL)
MQLONG Value: 0 (0x00000000)
MQCFIN (com.ibm.mq.headers.internal.ReflectingStore [encoding: 0x00000001, ccsid: 1208])
MQLONG Type: 3 (0x00000003)
MQLONG StrucLength: 16 (0x00000010)
MQLONG Parameter: 78 (MQIA_NPM_CLASS)
MQLONG Value: 0 (0x00000000)
MQCFIN (com.ibm.mq.headers.internal.ReflectingStore [encoding: 0x00000001, ccsid: 1208])
MQLONG Type: 3 (0x00000003)
MQLONG StrucLength: 16 (0x00000010)
MQLONG Parameter: 18 (MQIA_OPEN_OUTPUT_COUNT)
MQLONG Value: 0 (0x00000000)
MQCFST (com.ibm.mq.headers.internal.ReflectingStore [encoding: 0x00000001, ccsid: 1208])
MQLONG Type: 4 (0x00000004)
MQLONG StrucLength: 68 (0x00000044)
MQLONG Parameter: 2012 (MQCA_PROCESS_NAME)
MQLONG CodedCharSetId: 1208 (0x000004b8)
MQLONG StringLength: 48 (0x00000030)
MQCHAR[] String: " "
MQCFIN (com.ibm.mq.headers.internal.ReflectingStore [encoding: 0x00000001, ccsid: 1208])
MQLONG Type: 3 (0x00000003)
MQLONG StrucLength: 16 (0x00000010)
MQLONG Parameter: 10 (MQIA_INHIBIT_PUT)
MQLONG Value: 0 (0x00000000)
MQCFIN (com.ibm.mq.headers.internal.ReflectingStore [encoding: 0x00000001, ccsid: 1208])
MQLONG Type: 3 (0x00000003)
MQLONG StrucLength: 16 (0x00000010)
MQLONG Parameter: 190 (MQIA_PROPERTY_CONTROL)
MQLONG Value: 0 (0x00000000)
MQCFIN (com.ibm.mq.headers.internal.ReflectingStore [encoding: 0x00000001, ccsid: 1208])
MQLONG Type: 3 (0x00000003)
MQLONG StrucLength: 16 (0x00000010)
MQLONG Parameter: 40 (MQIA_Q_DEPTH_HIGH_LIMIT)
MQLONG Value: 80 (0x00000050)
MQCFIN (com.ibm.mq.headers.internal.ReflectingStore [encoding: 0x00000001, ccsid: 1208])
MQLONG Type: 3 (0x00000003)
MQLONG StrucLength: 16 (0x00000010)
MQLONG Parameter: 41 (MQIA_Q_DEPTH_LOW_LIMIT)
MQLONG Value: 20 (0x00000014)
MQCFIN (com.ibm.mq.headers.internal.ReflectingStore [encoding: 0x00000001, ccsid: 1208])
MQLONG Type: 3 (0x00000003)
MQLONG StrucLength: 16 (0x00000010)
MQLONG Parameter: 43 (MQIA_Q_DEPTH_HIGH_EVENT)
MQLONG Value: 0 (0x00000000)
MQCFIN (com.ibm.mq.headers.internal.ReflectingStore [encoding: 0x00000001, ccsid: 1208])
MQLONG Type: 3 (0x00000003)
MQLONG StrucLength: 16 (0x00000010)
MQLONG Parameter: 44 (MQIA_Q_DEPTH_LOW_EVENT)
MQLONG Value: 0 (0x00000000)
MQCFIN (com.ibm.mq.headers.internal.ReflectingStore [encoding: 0x00000001, ccsid: 1208])
MQLONG Type: 3 (0x00000003)
MQLONG StrucLength: 16 (0x00000010)
MQLONG Parameter: 42 (MQIA_Q_DEPTH_MAX_EVENT)
MQLONG Value: 1 (0x00000001)
MQCFIN (com.ibm.mq.headers.internal.ReflectingStore [encoding: 0x00000001, ccsid: 1208])
MQLONG Type: 3 (0x00000003)
MQLONG StrucLength: 16 (0x00000010)
MQLONG Parameter: 46 (MQIA_Q_SERVICE_INTERVAL_EVENT)
MQLONG Value: 0 (0x00000000)
MQCFIN (com.ibm.mq.headers.internal.ReflectingStore [encoding: 0x00000001, ccsid: 1208])
MQLONG Type: 3 (0x00000003)
MQLONG StrucLength: 16 (0x00000010)
MQLONG Parameter: 54 (MQIA_Q_SERVICE_INTERVAL)
MQLONG Value: 999999999 (0x3b9ac9ff)
MQCFIN (com.ibm.mq.headers.internal.ReflectingStore [encoding: 0x00000001, ccsid: 1208])
MQLONG Type: 3 (0x00000003)
MQLONG StrucLength: 16 (0x00000010)
MQLONG Parameter: 21 (MQIA_RETENTION_INTERVAL)
MQLONG Value: 999999999 (0x3b9ac9ff)
MQCFIN (com.ibm.mq.headers.internal.ReflectingStore [encoding: 0x00000001, ccsid: 1208])
MQLONG Type: 3 (0x00000003)
MQLONG StrucLength: 16 (0x00000010)
MQLONG Parameter: 45 (MQIA_SCOPE)
MQLONG Value: 1 (0x00000001)
MQCFIN (com.ibm.mq.headers.internal.ReflectingStore [encoding: 0x00000001, ccsid: 1208])
MQLONG Type: 3 (0x00000003)
MQLONG StrucLength: 16 (0x00000010)
MQLONG Parameter: 23 (MQIA_SHAREABILITY)
MQLONG Value: 1 (0x00000001)
MQCFIN (com.ibm.mq.headers.internal.ReflectingStore [encoding: 0x00000001, ccsid: 1208])
MQLONG Type: 3 (0x00000003)
MQLONG StrucLength: 16 (0x00000010)
MQLONG Parameter: 128 (MQIA_STATISTICS_Q)
MQLONG Value: -3 (0xfffffffd)
MQCFST (com.ibm.mq.headers.internal.ReflectingStore [encoding: 0x00000001, ccsid: 1208])
MQLONG Type: 4 (0x00000004)
MQLONG StrucLength: 84 (0x00000054)
MQLONG Parameter: 2023 (MQCA_TRIGGER_DATA)
MQLONG CodedCharSetId: 1208 (0x000004b8)
MQLONG StringLength: 64 (0x00000040)
MQCHAR[] String: " "
MQCFIN (com.ibm.mq.headers.internal.ReflectingStore [encoding: 0x00000001, ccsid: 1208])
MQLONG Type: 3 (0x00000003)
MQLONG StrucLength: 16 (0x00000010)
MQLONG Parameter: 29 (MQIA_TRIGGER_DEPTH)
MQLONG Value: 1 (0x00000001)
MQCFIN (com.ibm.mq.headers.internal.ReflectingStore [encoding: 0x00000001, ccsid: 1208])
MQLONG Type: 3 (0x00000003)
MQLONG StrucLength: 16 (0x00000010)
MQLONG Parameter: 26 (MQIA_TRIGGER_MSG_PRIORITY)
MQLONG Value: 0 (0x00000000)
MQCFIN (com.ibm.mq.headers.internal.ReflectingStore [encoding: 0x00000001, ccsid: 1208])
MQLONG Type: 3 (0x00000003)
MQLONG StrucLength: 16 (0x00000010)
MQLONG Parameter: 28 (MQIA_TRIGGER_TYPE)
MQLONG Value: 1 (0x00000001)
MQCFIN (com.ibm.mq.headers.internal.ReflectingStore [encoding: 0x00000001, ccsid: 1208])
MQLONG Type: 3 (0x00000003)
MQLONG StrucLength: 16 (0x00000010)
MQLONG Parameter: 12 (MQIA_USAGE)
MQLONG Value: 0 (0x00000000)
>>> Disconnecting... |
How is it so ?
I clearly specified
Code: |
request.addParameter ( MQConstants.MQIACF_CLUSTER_INFO, MQConstants.MQIA_CLWL_Q_PRIORITY ) ; |
Guess it is the way it works.
So, now the real question : how to get an INTEGER VALUE out of this message ?
Sebastian. |
|
Back to top |
|
 |
sebastia |
Posted: Sat Feb 15, 2014 5:49 am Post subject: |
|
|
 Grand Master
Joined: 07 Oct 2004 Posts: 1003
|
(...) cont
I am pretty sure the filter must be in the form of
Code: |
for (int i = 0; i < responses.length; i++)
{
String name = responses [i].getStringParameterValue (CMQC.MQCA_Q_NAME);
int depth = responses [i].getIntParameterValue (CMQC.MQIA_CURRENT_Q_DEPTH);
System.out.println ("Queue " + name + " curdepth " + depth);
} |
... but it seems I cant find the proper CMQC values ... |
|
Back to top |
|
 |
sebastia |
Posted: Sat Feb 15, 2014 8:22 am Post subject: |
|
|
 Grand Master
Joined: 07 Oct 2004 Posts: 1003
|
all right
think I got it
Code: |
for ( int i = 0; i < responses.length; i++ )
{
String name = responses [i].getStringParameterValue ( MQConstants.MQCA_Q_NAME);
int prio = responses [i].getIntParameterValue ( MQConstants.MQIA_CLWL_Q_PRIORITY ) ;
System.out.println ( "Queue " + name + " cur prio " + prio ) ;
} ; |
... produces ...
Code: |
Queue QLIN curdepth 5
>>> Disconnecting... |
Last edited by sebastia on Sat Feb 15, 2014 8:24 am; edited 1 time in total |
|
Back to top |
|
 |
fjb_saper |
Posted: Sat Feb 15, 2014 8:23 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
You need to read your replies more carefully. It is specified loud and clear:
Code: |
MQCFIN (com.ibm.mq.headers.internal.ReflectingStore [encoding: 0x00000001, ccsid: 1208])
MQLONG Type: 3 (0x00000003)
MQLONG StrucLength: 16 (0x00000010)
MQLONG Parameter: 96 (MQIA_CLWL_Q_PRIORITY)
MQLONG Value: 5 (0x00000005) |
So how can you not get the value 5 out of this?  _________________ MQ & Broker admin |
|
Back to top |
|
 |
sebastia |
Posted: Sat Feb 15, 2014 8:31 am Post subject: |
|
|
 Grand Master
Joined: 07 Oct 2004 Posts: 1003
|
Hi, mr Saper.
First, I was quite surprised to get such a large response for such a short request.
Then, I tried to filter the response to my needs.
And here is what I got:
Code: |
for ( int i = 0; i < responses.length; i++ )
{
String name = responses [i].getStringParameterValue ( MQConstants.MQCA_Q_NAME);
int prio = responses [i].getIntParameterValue ( MQConstants.MQIA_CLWL_Q_PRIORITY ) ;
System.out.println ( "Queue " + name + " cur prio (" + prio + ")" ) ;
} ; |
Well, all that informatic stuff is very easy ... when it works as suposed.
But, sometimes, a single bit of mis-configuration can have me testing for hours and hours ...
Code: |
+++ Connected
+++ Received reply, lng (1).
Queue QLIN cur prio (9)
>>> Disconnecting...
|
Thanks. Sebastian. |
|
Back to top |
|
 |
sebastia |
Posted: Sat Feb 15, 2014 8:36 am Post subject: |
|
|
 Grand Master
Joined: 07 Oct 2004 Posts: 1003
|
Well, here is the final code to read the cluster priority for a queue:
Code: |
// code to read Cluster Priority for a queue
import java.io.IOException ;
import com.ibm.mq.MQException ;
import com.ibm.mq.constants.MQConstants ;
import com.ibm.mq.pcf.* ; // PCFMessagAgent
public class jeff_getQ {
public static void main( String[] args ) {
try {
System.out.println ( ">>> MQ Get Queue parameter using PCF by Jeff, v 20140215a") ;
PCFMessageAgent agent = new PCFMessageAgent( "localhost", 2415, "SAG.SVRCONN" );
System.out.println ( "+++ Connected" ) ;
// Build the request
PCFMessage request = new PCFMessage ( MQConstants.MQCMD_INQUIRE_Q ) ; // inquiry
request.addParameter ( MQConstants.MQCA_Q_NAME, "QLIN" ) ; // queue name
request.addParameter ( MQConstants.MQIA_Q_TYPE, MQConstants.MQQT_LOCAL ) ; // q type = local queue
request.addParameter ( MQConstants.MQIACF_CLUSTER_INFO, MQConstants.MQIA_CLWL_Q_PRIORITY ) ; // get actual priority
PCFMessage[] responses = agent.send ( request ) ;
System.out.println ( "+++ Received reply, lng ("+ responses.length + ")." ) ;
// for ( PCFMessage pcfMessage : responses ) {
// System.out.println ( pcfMessage ) ;
// } ; // for
for ( int i = 0; i < responses.length; i++ )
{
String name = responses [i].getStringParameterValue ( MQConstants.MQCA_Q_NAME ) ;
int prio = responses [i].getIntParameterValue ( MQConstants.MQIA_CLWL_Q_PRIORITY ) ;
System.out.println ( "Queue " + name + " cur prio (" + prio + ")" ) ;
} ;
// Disconnect
System.out.println ( ">>> Disconnecting... " ) ;
agent.disconnect () ;
} // try
catch ( MQException mqe ) {
System.err.println ( mqe ) ;
}
catch ( IOException ioe ) {
System.err.println ( ioe ) ;
}
} ; // main()
} ; // |
|
|
Back to top |
|
 |
sebastia |
Posted: Sat Feb 15, 2014 9:04 am Post subject: |
|
|
 Grand Master
Joined: 07 Oct 2004 Posts: 1003
|
Hi, mr Saper - yes, I got the idea.
But the basic fact(s) is/are that
1) this is absolutely bad/wrong documented
2) there are no samples at all with the product
3) I get strange results /rc's without a proper detail/explanation
Well ... guess MQ v8 will improve it.
JeJeJe
Bets luck. Sebastian. |
|
Back to top |
|
 |
fjb_saper |
Posted: Sat Feb 15, 2014 9:19 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
I suspect you may have a problem with typing...
I can only think that you either have a typing problem (from type) or that for that particular parameter you have to iterate through the message's parameters and filter there... (maybe not the right parm type name?)
Anyways did you try
pcfmessage and not responses[i] inside the loop.
Code: |
PCFMessage pcfmessage = null;
for ( int i = 0; i < responses.length; i++ )
{
pcfmessage = (PCFMessage) responses[i];
String name = pcfmessage.getStringParameterValue ( MQConstants.MQCA_Q_NAME ) ;
int prio = pcfmessage.getIntParameterValue ( MQConstants.MQIA_CLWL_Q_PRIORITY ) ;
System.out.println ( "Queue " + name + " cur prio (" + prio + ")" ) ;
} ;
|
Have Fun  _________________ MQ & Broker admin |
|
Back to top |
|
 |
sebastia |
Posted: Sat Feb 15, 2014 9:50 am Post subject: |
|
|
 Grand Master
Joined: 07 Oct 2004 Posts: 1003
|
mr Saper, I have to admit I have typing problems.
And more than that, to tell the truth.
(1) I know I can code this
Code: |
PCFMessage[] responses = agent.send ( request ) |
... and also I can code this
Code: |
MQMessage[] pcfResponses = agent.send(CMQCFC.MQCMD_CHANGE_Q, parameters); |
So, I cant understand if "agent.send" comes back ...
a) with PCFMessage[]
or
b) with MQMessage[]
(2) I dont know the difference between
Code: |
import com.ibm.mq.pcf.PCFMessage ;
import com.ibm.mq.headers.pcf.PCFMessage ; |
Guess I need some more Java/Eclipse training ... but I try
Cheers ! Sebastian, with "typing" problems, and more. |
|
Back to top |
|
 |
fjb_saper |
Posted: Sat Feb 15, 2014 10:35 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
Can't remember exactly but I seem to recall that not all parameters can be extracted from the PCFMessage.
I did something with PCF a while back and remember having to iterate through the parameters collection of a PCFMessage to get what I was looking for... Maybe you have to do it too....
Have fun  _________________ MQ & Broker admin |
|
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
|
|
|
|