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 » Reading PCF Group Parameter (MQCFGR) using MS0B

Post new topic  Reply to topic
 Reading PCF Group Parameter (MQCFGR) using MS0B « View previous topic :: View next topic » 
Author Message
mandos_
PostPosted: Mon Mar 12, 2007 7:55 pm    Post subject: Reading PCF Group Parameter (MQCFGR) using MS0B Reply with quote

Novice

Joined: 17 Nov 2006
Posts: 17

Hail!

I was trying to parse some Queue statistics messages. But i have a problem when I get a Group Parameter.

First I instance a PCFMessage with the message browsed from queue. (see code)

The first problem was that when I use getParameters(); method that returns a Enumeration the parameters in PCF Group Parameter (MQCFGR) becomes inaccessible.

Ok, then I can access these parameters using the getParameter(int parameter); that returns a PCFParameter (superclass of MQCFGR). only casting the return. That works fine!

The problem: Using this way I access only ONE MQCFGR (PCF Group Parameter), 'cause using the getParameter(int parameter); returns always the same instance of MQCFGR...

Using the Enumeration solution I can see (and only see) that exists more than one MQCFGR.

My question: How can I access these others MQCFGR without using the getParameters();? And accessing the parameters in that groups...

Here is the code:

Code:
public void doStatisticParse() throws MQException, IOException{
      MQCFGR sgroup = new MQCFGR();
      MQQueue queue = qm.accessQueue("SYSTEM.ADMIN.STATISTICS.QUEUE", MQC.MQOO_BROWSE | MQC.MQOO_FAIL_IF_QUIESCING | MQC.MQOO_INPUT_AS_Q_DEF);
      MQGetMessageOptions gmo = new MQGetMessageOptions();
      gmo.options = MQC.MQGMO_BROWSE_NEXT;
      MQMessage msg = new MQMessage();
      queue.get(msg, gmo);
      PCFMessage message = new PCFMessage(msg);
      sgroup = (MQCFGR)message.getParameter(8011);      
      Enumeration e = message.getParameters();
      for(int i=1;e.hasMoreElements();i++){
         PCFParameter p = (PCFParameter)e.nextElement();
         System.out.println("Parameter "+i+": "+p.getParameter()); //Just to see the content of the others parameters
      }
      e = sgroup.getParameters();
      for(int i=1;e.hasMoreElements();i++){
         PCFParameter p = (PCFParameter)e.nextElement();
         System.out.println("Parameter "+i+" in sgroup: "+p.getParameter()); //Just to see the parameters in the GROUP
      }
   }



And here is the content of the message (result of System.out.println(message);):

Code:
PCFMessage:
MQCFH [type: 21, strucLength: 36, version: 3, command: 165 (MQCMD_STATISTICS_Q), msgSeqNumber: 1, control: 1, compCode: 0, reason: 0, parameterCount: 9]
MQCFST [type: 4, strucLength: 68, parameter: 2015 (MQCA_Q_MGR_NAME), codedCharSetId: 0, stringLength: 48, string: QM1                                             ]
MQCFST [type: 4, strucLength: 32, parameter: 2711 (MQCAMO_START_DATE), codedCharSetId: 0, stringLength: 10, string: 2007-03-12]
MQCFST [type: 4, strucLength: 28, parameter: 2712 (MQCAMO_START_TIME/MQCAMO_LAST_USED), codedCharSetId: 0, stringLength: 8, string: 19.02.44]
MQCFST [type: 4, strucLength: 32, parameter: 2707 (MQCAMO_END_DATE), codedCharSetId: 0, stringLength: 10, string: 2007-03-12]
MQCFST [type: 4, strucLength: 28, parameter: 2708 (MQCAMO_END_TIME), codedCharSetId: 0, stringLength: 8, string: 19.02.46]
MQCFIN [type: 3, strucLength: 16, parameter: 31 (MQIA_COMMAND_LEVEL), value: 600]
MQCFIN [type: 3, strucLength: 16, parameter: 732 (MQIAMO_OBJECT_COUNT), value: 2]
MQCFGR [type: 20, strucLength: 16, parameter: 8011 (MQGACF_Q_STATISTICS_DATA), parameterCount: 22 {
MQCFST [type: 4, strucLength: 68, parameter: 2016 (MQCA_Q_NAME), codedCharSetId: 0, stringLength: 48, string: SYSTEM.ADMIN.COMMAND.QUEUE                      ]
MQCFST [type: 4, strucLength: 32, parameter: 2004 (MQCA_CREATION_DATE), codedCharSetId: 0, stringLength: 12, string: 2006-11-19  ]
MQCFST [type: 4, strucLength: 28, parameter: 2005 (MQCA_CREATION_TIME), codedCharSetId: 0, stringLength: 8, string: 18.20.07]
MQCFIN [type: 3, strucLength: 16, parameter: 20 (MQIA_Q_TYPE), value: 1]
MQCFIN [type: 3, strucLength: 16, parameter: 7 (MQIA_DEFINITION_TYPE), value: 1]
MQCFIN [type: 3, strucLength: 16, parameter: 740 (MQIAMO_Q_MIN_DEPTH), value: 0]
MQCFIN [type: 3, strucLength: 16, parameter: 739 (MQIAMO_Q_MAX_DEPTH), value: 1]
MQCFIL [type: 5, strucLength: 24, parameter: 703 (MQIAMO_AVG_Q_TIME), count: 2, values: {1306, 0}]
MQCFIL [type: 5, strucLength: 24, parameter: 735 (MQIAMO_PUTS), count: 2, values: {9, 0}]
MQCFIN [type: 3, strucLength: 16, parameter: 754 (MQIAMO_PUTS_FAILED), value: 0]
MQCFIL [type: 5, strucLength: 24, parameter: 734 (MQIAMO_PUT1S), count: 2, values: {0, 0}]
MQCFIN [type: 3, strucLength: 16, parameter: 755 (MQIAMO_PUT1S_FAILED), value: 0]
MQCFIL64 [type: 25, strucLength: 32, parameter: 748 (MQIAMO64_PUT_BYTES), count: 2, values: {728, 0}]
MQCFIL [type: 5, strucLength: 24, parameter: 722 (MQIAMO_GETS), count: 2, values: {4, 0}]
MQCFIL64 [type: 25, strucLength: 32, parameter: 747 (MQIAMO64_GET_BYTES), count: 2, values: {316, 0}]
MQCFIN [type: 3, strucLength: 16, parameter: 725 (MQIAMO_GETS_FAILED), value: 0]
MQCFIL [type: 5, strucLength: 24, parameter: 705 (MQIAMO_BROWSES), count: 2, values: {0, 0}]
MQCFIL64 [type: 25, strucLength: 32, parameter: 745 (MQIAMO64_BROWSE_BYTES), count: 2, values: {0, 0}]
MQCFIN [type: 3, strucLength: 16, parameter: 708 (MQIAMO_BROWSES_FAILED), value: 0]
MQCFIN [type: 3, strucLength: 16, parameter: 759 (MQIAMO_MSGS_NOT_QUEUED), value: 0]
MQCFIN [type: 3, strucLength: 16, parameter: 758 (MQIAMO_MSGS_EXPIRED), value: 0]
MQCFIN [type: 3, strucLength: 16, parameter: 760 (MQIAMO_MSGS_PURGED/MQIAMO_LAST_USED), value: 0]}]
MQCFGR [type: 20, strucLength: 16, parameter: 8011 (MQGACF_Q_STATISTICS_DATA), parameterCount: 22 {
MQCFST [type: 4, strucLength: 68, parameter: 2016 (MQCA_Q_NAME), codedCharSetId: 0, stringLength: 48, string: AMQ.MQEXPLORER.2050783804                       ]
MQCFST [type: 4, strucLength: 32, parameter: 2004 (MQCA_CREATION_DATE), codedCharSetId: 0, stringLength: 12, string: 2007-03-12  ]
MQCFST [type: 4, strucLength: 28, parameter: 2005 (MQCA_CREATION_TIME), codedCharSetId: 0, stringLength: 8, string: 18.30.00]
MQCFIN [type: 3, strucLength: 16, parameter: 20 (MQIA_Q_TYPE), value: 1]
MQCFIN [type: 3, strucLength: 16, parameter: 7 (MQIA_DEFINITION_TYPE), value: 3]
MQCFIN [type: 3, strucLength: 16, parameter: 740 (MQIAMO_Q_MIN_DEPTH), value: 0]
MQCFIN [type: 3, strucLength: 16, parameter: 739 (MQIAMO_Q_MAX_DEPTH), value: 1]
MQCFIL [type: 5, strucLength: 24, parameter: 703 (MQIAMO_AVG_Q_TIME), count: 2, values: {96, 0}]
MQCFIL [type: 5, strucLength: 24, parameter: 735 (MQIAMO_PUTS), count: 2, values: {73, 0}]
MQCFIN [type: 3, strucLength: 16, parameter: 754 (MQIAMO_PUTS_FAILED), value: 0]
MQCFIL [type: 5, strucLength: 24, parameter: 734 (MQIAMO_PUT1S), count: 2, values: {0, 0}]
MQCFIN [type: 3, strucLength: 16, parameter: 755 (MQIAMO_PUT1S_FAILED), value: 0]
MQCFIL64 [type: 25, strucLength: 32, parameter: 748 (MQIAMO64_PUT_BYTES), count: 2, values: {60516, 0}]
MQCFIL [type: 5, strucLength: 24, parameter: 722 (MQIAMO_GETS), count: 2, values: {73, 0}]
MQCFIL64 [type: 25, strucLength: 32, parameter: 747 (MQIAMO64_GET_BYTES), count: 2, values: {60516, 0}]
MQCFIN [type: 3, strucLength: 16, parameter: 725 (MQIAMO_GETS_FAILED), value: 0]
MQCFIL [type: 5, strucLength: 24, parameter: 705 (MQIAMO_BROWSES), count: 2, values: {0, 0}]
MQCFIL64 [type: 25, strucLength: 32, parameter: 745 (MQIAMO64_BROWSE_BYTES), count: 2, values: {0, 0}]
MQCFIN [type: 3, strucLength: 16, parameter: 708 (MQIAMO_BROWSES_FAILED), value: 0]
MQCFIN [type: 3, strucLength: 16, parameter: 759 (MQIAMO_MSGS_NOT_QUEUED), value: 0]
MQCFIN [type: 3, strucLength: 16, parameter: 758 (MQIAMO_MSGS_EXPIRED), value: 0]
MQCFIN [type: 3, strucLength: 16, parameter: 760 (MQIAMO_MSGS_PURGED/MQIAMO_LAST_USED), value: 0]}]


See that the value 2 of the parameter MQIAMO_OBJECT_COUNT indicates 2 MQCFGR (or QStatisticsData) but i can only access one...

If someone can help me...

Thanks...

Sweet Dreams!
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Tue Mar 13, 2007 4:42 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

I guess I would do
Code:
MQCFGR sgroup = new MQCFGR(message.getParameter(8011));
rather than the way you are doing it.

Other than that, I'm not entirely sure what your problem is. But go back and re-read the PCF documentation on the Queue Statistics message you're trying to read, and then look at the documentation for ms0b again and try and match the two.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
Michael Dag
PostPosted: Tue Mar 13, 2007 4:52 am    Post subject: Reply with quote

Jedi Knight

Joined: 13 Jun 2002
Posts: 2607
Location: The Netherlands (Amsterdam)

When accessing these 2 groups and you only get 1, which one do you get?

SYSTEM.ADMIN.COMMAND.QUEUE
or
AMQ.MQEXPLORER.2050783804

if the last, maybe you should start with 0 rather then 1 ? (just a wild guess...)
_________________
Michael



MQSystems Facebook page
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
mandos_
PostPosted: Tue Mar 13, 2007 5:59 am    Post subject: Reply with quote

Novice

Joined: 17 Nov 2006
Posts: 17

jefflowrey,

The constructor

Code:
MQCFGR sgroup = new MQCFGR(message.getParameter(8011));


is undefined... The getParameter(8011) returns a PCFParameter...

My problem is that the statistics message has 2 PFC Group Parameter (that int value is 8011) and i can only access ONE using the getParameter(8011), cause always that i call this method that returns the same group.... But the parameter value (8011 or MQGACF_Q_STATISTICS_DATA as you can see in the message content) is the same of course...


Michael Dag,

When I do getParameter(8011) that returns the SYSTEM.ADMIN.COMMAND.QUEUE...

I'm not accessing the 2 groups, but only one using the method described in code...

How can I access these TWO groups??? And not only one?

Thanks...
Back to top
View user's profile Send private message
mandos_
PostPosted: Thu Mar 22, 2007 10:36 am    Post subject: Reply with quote

Novice

Joined: 17 Nov 2006
Posts: 17

Hail!

Someone here knows something about read Queue Statistics messages with java ms0b supportpac??

Someone can help me???

Michael Dag,

Starts what with 0 rather than 1? o.O

May it be a bug in ms0b???

Thanks,

Danilo Barboza
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Thu Mar 22, 2007 11:41 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

MichaelDag was talking about your code, where you intitialize your loop counter to 1.

And suggesting that you may need to start it at 0.
_________________
I am *not* the model of the modern major general.
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 » Reading PCF Group Parameter (MQCFGR) using MS0B
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.