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 API Support » Getting List of Queues

Post new topic  Reply to topic Goto page Previous  1, 2
 Getting List of Queues « View previous topic :: View next topic » 
Author Message
Michael Dag
PostPosted: Sat Mar 26, 2005 7:23 am    Post subject: Reply with quote

Jedi Knight

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

klamerus wrote:
I appreciate these are rather fundamental questions and the help that everyone's been providing. I have found that there are very few flames or rants in this forum, which is very refreshing.

let's just say integration people are a rare species, no point in burning someone else down, the occasional freebie riders can easily be picked out of the crowed and get put in there place politely...
_________________
Michael



MQSystems Facebook page
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
kevinf2349
PostPosted: Sat Mar 26, 2005 7:42 am    Post subject: Reply with quote

Grand Master

Joined: 28 Feb 2003
Posts: 1311
Location: USA

Just to play devils advocate for a little while....if money isn't a big issue...why not buy in the MQ skills in the form of a new employee? That way you would have onsite help whenever you needed it
Back to top
View user's profile Send private message
klamerus
PostPosted: Sat Mar 26, 2005 9:55 am    Post subject: Reply with quote

Disciple

Joined: 05 Jul 2004
Posts: 199
Location: Detroit, MI

Well, I look at forums as a place for Q&A, and there's no A without Q

So far as employees goes, it's a question of supply and demand. Supply of people with these skills is low, but demand is even lower. I've just inherited this system from another guy who was responsible for it. It is about 4 years old. This is something I'm putting in place to improve client relationship and improve support (items he apparently thought that important). Once this is done, we're back to really only needing our in-house support skills and limited programming skills. Actually, that's only half true. We've got a pretty decent amount of code working with the queues, in C, but strictly for the purpose of adding and removing messages. Nothing in this area. I'm getting the team training on MQ (and a bunch of other stuff), but it's not there now.
Back to top
View user's profile Send private message Send e-mail AIM Address Yahoo Messenger MSN Messenger
kevinf2349
PostPosted: Sat Mar 26, 2005 4:39 pm    Post subject: Reply with quote

Grand Master

Joined: 28 Feb 2003
Posts: 1311
Location: USA

That makes sense if the demand isn't there. This website is a truly valuable resource, especially when used correctly.

I think most of the rants and flames are directed towards those (thankfully few) people that post what are essentially very basic MQ questions without even attempting to get search results before hand....or even pick up the manual.

I am a long time MVS system programmer and I have to say that I find the MQ Manuals are some of the very best out there...more readable than many of the z/OS ones thats for sure!
Back to top
View user's profile Send private message
malammik
PostPosted: Mon Mar 28, 2005 7:00 am    Post subject: Reply with quote

Partisan

Joined: 27 Jan 2005
Posts: 397
Location: Philadelphia, PA

public List getQueueNames() {
PCFAgent agent = null;
Set queueNames = new HashSet();
try {
agent = MqPcfUtil.getPCFAgent(qmanager);
if(agent == null){
logger.info("PCFAgent failed to connect Queue Manager :" + qmanager.getQmanager_nm());
return Collections.EMPTY_LIST;
}

logger.debug("got connection");
PCFParameter[] parameters = { new MQCFST(CMQC.MQCA_Q_NAME, QFlexUtil.STAR), new MQCFIN(CMQC.MQIA_Q_TYPE, CMQC.MQQT_LOCAL)};

logger.debug("sending responses");
MQMessage[] responses = agent.send(CMQCFC.MQCMD_INQUIRE_Q, parameters);
logger.debug("got reply");

logger.debug("parsing responses");
List responseParameters = MqPcfUtil.getMessagesParameterMap(responses);
logger.debug("parsing responses complete");

for (int i = 0; i < responseParameters.size(); i++) {
Map pcfParams = (Map) responseParameters.get(i);
String queueName = (String) pcfParams.get(new Integer(CMQC.MQCA_Q_NAME));

// Collect queue names.
if (StringUtils.isNotEmpty(queueName)) {
// Check if queue name has to be skipped.
if (isNotFilteredObject(QUEUE_FILTERS, queueName)){
queueNames.add(queueName.trim());
//logger.debug(queueName);
}
}
}
}
catch (MQException e) {
logger.error("CC " + e.completionCode + " RC :" + e.reasonCode, e);
}
catch (IOException e) {
logger.error(e.getMessage(), e);
}
finally{
if(agent != null){
// Disconnect PCF agent.
logger.info("Disconnecting PCFAgent for queue manager " + agent.getQManagerName());
try {
agent.disconnect();
logger.info("Disconnected.");
}
catch (MQException e) {
logger.error(e.getMessage(), e);
}
}
}
return new ArrayList(queueNames);
}

public static List getMessagesParameterMap(MQMessage[] responses) {
List messages = new ArrayList(responses.length);
logger.info("Received reply from PCFAgent of size (" + responses.length + ")");

try {
for (int i = 0; i < responses.length; i++) {
MQCFH cfh = new MQCFH(responses[i]);

// Check the PCF header (MQCFH) in the response message
if (cfh.reason == 0) // Case no errors were reported.
{
// Iterate through a list of parameters of each response.
Map parameters = new HashMap();
for (int j = 0; j < cfh.parameterCount; j++) {
PCFParameter p = PCFParameter.nextParameter(responses[i]);
parameters.put(new Integer(p.getParameter()), p.getValue());
}
messages.add(parameters);
}
else {
logger.info("Failure to read parameters due to: " + cfh);

// Walk through the returned parameters describing the error
for (i = 0; i < cfh.parameterCount; i++) {
logger.info(PCFParameter.nextParameter(responses[0]));
}
}
}
}
catch (MQException mqe) {
logger.error(mqe.getMessage(), mqe);
}
catch (IOException ioe) {
logger.error(ioe.getMessage(), ioe);
}
return messages;
}
_________________
Mikhail Malamud
http://www.netflexity.com
http://groups.google.com/group/qflex
Back to top
View user's profile Send private message Visit poster's website AIM Address
klamerus
PostPosted: Thu Apr 07, 2005 2:24 am    Post subject: Reply with quote

Disciple

Joined: 05 Jul 2004
Posts: 199
Location: Detroit, MI

Thanks for the long sample. I'll need to see if I can accomlish the same in VB or VB.Net as described in the other posting. Java is a no-no at my current client.
Back to top
View user's profile Send private message Send e-mail AIM Address Yahoo Messenger MSN Messenger
fjb_saper
PostPosted: Thu Apr 07, 2005 12:53 pm    Post subject: Reply with quote

Grand High Poobah

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

Look at .NET. This means you can still use all the Java objects.

Just instantiate them in .NET (J#)

Enjoy
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic  Reply to topic Goto page Previous  1, 2 Page 2 of 2

MQSeries.net Forum Index » IBM MQ API Support » Getting List of Queues
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.