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 » PCF get qmanager details

Post new topic  Reply to topic
 PCF get qmanager details « View previous topic :: View next topic » 
Author Message
vasilev
PostPosted: Tue Oct 22, 2019 12:19 am    Post subject: PCF get qmanager details Reply with quote

Acolyte

Joined: 31 Oct 2014
Posts: 58
Location: Germany

Hello all,
i am trying to get some details of the qmanager:

CCSID
VERSION
QMID
SSLKEYR

and so on.
i have searched and find one topic, cannot find how to read these ParameterValues.
this is the code:

Code:
PCFMessage   msg = new PCFMessage (CMQCFC.MQCMD_INQUIRE_CLUSTER_Q_MGR);
                     msg.addParameter (CMQC.MQCA_CLUSTER_Q_MGR_NAME, "*");
                     PCFMessage[] responses = a.send(msg);


here when i debug, i see it is under MQCFST and called MQCA_VERSION - for the version for example, but when i try to get it:

Code:
String []   names = (String []) responses [0].getParameterValue (MQCFST.MQCA_VERSION);


then i got exception. or error.
can you help me.

thanks !
Back to top
View user's profile Send private message Visit poster's website
fjb_saper
PostPosted: Tue Oct 22, 2019 2:44 am    Post subject: Re: PCF get qmanager details Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20696
Location: LI,NY

vasilev wrote:
Hello all,
i am trying to get some details of the qmanager:

CCSID
VERSION
QMID
SSLKEYR

and so on.
i have searched and find one topic, cannot find how to read these ParameterValues.
this is the code:

Code:
PCFMessage   msg = new PCFMessage (CMQCFC.MQCMD_INQUIRE_CLUSTER_Q_MGR);
                     msg.addParameter (CMQC.MQCA_CLUSTER_Q_MGR_NAME, "*");
                     PCFMessage[] responses = a.send(msg);


here when i debug, i see it is under MQCFST and called MQCA_VERSION - for the version for example, but when i try to get it:

Code:
String []   names = (String []) responses [0].getParameterValue (MQCFST.MQCA_VERSION);


then i got exception. or error.
can you help me.

thanks !

Too much stuff on your responses line.
Treat the responses one by one.
off the cuff

Code:
String  value = responses[0].getParameterValue(MQConstants.MQCA_VERSION);


Have fun
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
vasilev
PostPosted: Tue Oct 22, 2019 5:11 am    Post subject: Reply with quote

Acolyte

Joined: 31 Oct 2014
Posts: 58
Location: Germany

..yes, i just start playing with qmanager attributes ..

many thanks !
Back to top
View user's profile Send private message Visit poster's website
RogerLacroix
PostPosted: Tue Oct 22, 2019 1:03 pm    Post subject: Re: PCF get qmanager details Reply with quote

Jedi Knight

Joined: 15 May 2001
Posts: 3252
Location: London, ON Canada

vasilev wrote:
i am trying to get some details of the qmanager:

CCSID
VERSION
QMID
SSLKEYR


vasilev wrote:
Code:
PCFMessage   msg = new PCFMessage (CMQCFC.MQCMD_INQUIRE_CLUSTER_Q_MGR);

Well, I'm confused. You want queue manager information but you inquire on cluster queue manager!?! Very weird!

Every PCF command that can be sent to the queue manager's command server is documented here.

Code:
PCFMessage request = new PCFMessage(CMQCFC.MQCMD_INQUIRE_Q_MGR);
request.addParameter (CMQCFC.MQIACF_Q_MGR_ATTRS,
                      new int [] { CMQC.MQCA_Q_MGR_NAME,
                                   CMQC.MQIA_CODED_CHAR_SET_ID,
                                   CMQC.MQCA_VERSION,
                                   CMQC.MQCA_Q_MGR_IDENTIFIER,
                                   CMQC.MQCA_SSL_KEY_REPOSITORY});
PCFMessage[] responses = agent.send(request);


Hence, you should get back 1 response message which you can extract the information from:

Code:
if ((responses[0]).getCompCode() == CMQC.MQCC_OK)
{
   System.out.println("QMgr Name:   "+responses[0].getStringParameterValue(CMQC.MQCA_Q_MGR_NAME));
   System.out.println("CCSID:       "+responses[0].getIntParameterValue(CMQC.MQIA_CODED_CHAR_SET_ID));
   System.out.println("Version:     "+responses[0].getStringParameterValue(CMQC.MQCA_VERSION));
   System.out.println("QM Id:       "+responses[0].getStringParameterValue(CMQC.MQCA_Q_MGR_IDENTIFIER));
   System.out.println("SSL Key Rep: "+responses[0].getStringParameterValue(CMQC.MQCA_SSL_KEY_REPOSITORY));
}


Regards,
Roger Lacroix
Capitalware Inc.
_________________
Capitalware: Transforming tomorrow into today.
Connected to MQ!
Twitter
Back to top
View user's profile Send private message Visit poster's website
vasilev
PostPosted: Fri Oct 25, 2019 1:45 am    Post subject: Reply with quote

Acolyte

Joined: 31 Oct 2014
Posts: 58
Location: Germany

Hello Roger,
yes, i took this code from some forum but changed because it is for different use
thank you for the info !
_________________
Regards
V.Vasilev
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » IBM MQ Java / JMS » PCF get qmanager details
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.