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 » General Discussion » Generating list of all queues in a queue manager via C++ API

Post new topic  Reply to topic
 Generating list of all queues in a queue manager via C++ API « View previous topic :: View next topic » 
Author Message
lab1301
PostPosted: Thu Sep 11, 2008 9:05 am    Post subject: Generating list of all queues in a queue manager via C++ API Reply with quote

Newbie

Joined: 11 Sep 2008
Posts: 2
Location: London, England

Environment: Solaris 10 with MQ client libraries

I’ve got no access to runmqsc as we only have a client installation. Does anyone know whether it’s possible to write C++ code linked with the MQ client libraries which can list all queues in a queue manager?

Regards
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Thu Sep 11, 2008 10:51 am    Post subject: Re: Generating list of all queues in a queue manager via C++ Reply with quote

Grand High Poobah

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

lab1301 wrote:
Environment: Solaris 10 with MQ client libraries

I’ve got no access to runmqsc as we only have a client installation. Does anyone know whether it’s possible to write C++ code linked with the MQ client libraries which can list all queues in a queue manager?

Regards

Check out the manuals there is something about PCF (Programmable Command Format) messages...

You can also use MO72 support pack (client form of mqsc)...

Enjoy
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
lab1301
PostPosted: Fri Sep 12, 2008 2:03 am    Post subject: Re: Generating list of all queues in a queue manager via C++ Reply with quote

Newbie

Joined: 11 Sep 2008
Posts: 2
Location: London, England

fjb_saper wrote:
lab1301 wrote:
Environment: Solaris 10 with MQ client libraries

I’ve got no access to runmqsc as we only have a client installation. Does anyone know whether it’s possible to write C++ code linked with the MQ client libraries which can list all queues in a queue manager?

Regards

Check out the manuals there is something about PCF (Programmable Command Format) messages...

You can also use MO72 support pack (client form of mqsc)...

Enjoy



Thanks for pointing me in the right direction. The MQ sample program amqsailq.c lists all queues and queue depths. Ideally I want a C++ API rather than a C API but it looks like I’ve got a potential solution.

The C++ code fragment that gives the queue depth of a named queue is as follows. You wouldn’t know whether there is a C++ API for listing all queues in a queue manager do you?

x-------------------------------------------------x
ImqQueueManager manager;
manager.setName(queueMgr.data());
if ( manager.connect() ) {
ImqString strQueueManagerName(manager.name());
cout << "Connected successfully to queue manager: <"
<< strQueueManagerName << ">" << endl;
ImqQueue *pqueue = new ImqQueue;
pqueue->setConnectionReference(manager);
pqueue->setName(queue.data());
MQLONG qdepth;
pqueue->currentDepth(qdepth);
if (qdepth < 0 ) {
cerr << prog << ": Fatal error. Please specify a valid queue"
<< endl;
returnCode = -1;
}
cout << "Depth of MQ queue: <" << pqueue->name() << "> is <"
<< qdepth << ">" << endl;
} else {
cerr << prog
<< ": ** Fatal. Connection failure to specified queue manager**"
<< endl;
cerr << "** ImqQueueManager::connect failed with reason code:" << manag
er.reasonCode() << endl;
returnCode = (int)manager.reasonCode();

}
}
catch ( std::string& error )
{
cerr << endl
<< "ERROR :: "
x-------------------------------------------------x

ebizqdepth $MQ_QUEUE_MANAGER $MQ_INBOUND_Q
Connected successfully to queue manager: <XXX.YYY.EBIZ.DEV>
Depth of MQ queue: <MA3.SR.CPY.OF.SWIFT.INBOUND> is <0>



Regards

Lakshman


Last edited by lab1301 on Fri Sep 12, 2008 7:30 am; edited 1 time in total
Back to top
View user's profile Send private message
exerk
PostPosted: Fri Sep 12, 2008 2:11 am    Post subject: Re: Generating list of all queues in a queue manager via C++ Reply with quote

Jedi Council

Joined: 02 Nov 2006
Posts: 6339

fjb_saper wrote:
You can also use MO72 support pack (client form of mqsc)...


A wheel is a wheel and needs no reinvention.
_________________
It's puzzling, I don't think I've ever seen anything quite like this before...and it's hard to soar like an eagle when you're surrounded by turkeys.
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 » General Discussion » Generating list of all queues in a queue manager via C++ API
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.