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 » How to retrieve names of objects in a queue manager

Post new topic  Reply to topic
 How to retrieve names of objects in a queue manager « View previous topic :: View next topic » 
Author Message
Cyberherbalist
PostPosted: Mon Jul 01, 2013 9:26 am    Post subject: How to retrieve names of objects in a queue manager Reply with quote

Newbie

Joined: 01 Jul 2013
Posts: 3

I am running Websphere MQ 7.5 in a Windows environment, and using the C# language. It seems to me that it should be possible to programmatically obtain a list of queues, channels, or process definitions in a given queue manager. However the API doesn't seem to have a provision for this.

I am thinking of something like:

Code:
MQQueueManager mgr = new MQQueueManager("PQM");
string[] queuenames = mgr.GetQueueNames();


Of course, no such method exists. Is there some back-door (or even front-door) way to get the information I am looking for?
Back to top
View user's profile Send private message
mqjeff
PostPosted: Mon Jul 01, 2013 10:42 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

http://pic.dhe.ibm.com/infocenter/wmqv7/v7r5/topic/com.ibm.mq.doc/pc13090_.htm
Back to top
View user's profile Send private message
gbaddeley
PostPosted: Mon Jul 01, 2013 3:40 pm    Post subject: Reply with quote

Jedi

Joined: 25 Mar 2003
Posts: 2495
Location: Melbourne, Australia

Are you an application programmer or a MQ administrator?

App programs should not have any requirement to enumerate queue names, channel names etc. This is a privileged operation in MQ and the programming is fairly complex. The queue names that an app program needs to use should be parameterized to the program.

If you are an MQ admin, there's a wealth of programs out there that can do this for you such as MQ Explorer or the venerable runmqsc, and also allow you to do lots of other useful things.
_________________
Glenn
Back to top
View user's profile Send private message
Cyberherbalist
PostPosted: Tue Jul 02, 2013 9:42 am    Post subject: Reply with quote

Newbie

Joined: 01 Jul 2013
Posts: 3

gbaddeley wrote:
Are you an application programmer or a MQ administrator?


Both, although recently they finally consolidated all our MQ servers into one admin group, and now I only have to worry about programming. I still maintain my admin privileges -- and they still expect me to chime in when necessary.

gbaddeley wrote:

App programs should not have any requirement to enumerate queue names, channel names etc. This is a privileged operation in MQ and the programming is fairly complex. The queue names that an app program needs to use should be parameterized to the program.


Or obtained from the TMC in the case of triggering, yes, I know.

gbaddeley wrote:

If you are an MQ admin, there's a wealth of programs out there that can do this for you such as MQ Explorer or the venerable runmqsc, and also allow you to do lots of other useful things.


But why do you feel obligated to limit me like this? What if I want to write my very own admin tool? What if I want to start my own software development company and specialize in developing and providing tools for MQ Admins, and so on?

Please somebody point me to a resource that tells me how to use PCF with .NET C# !! Prefereably a resource that deals with at least MQ v7. Please don't tell me it's none of my business.
Back to top
View user's profile Send private message
mqjeff
PostPosted: Tue Jul 02, 2013 11:42 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

Cyberherbalist wrote:
Please somebody point me to a resource that tells me how to use PCF with .NET C# !! Prefereably a resource that deals with at least MQ v7. Please don't tell me it's none of my business.


I don't think the .NET classes provide an abstraction/object model of PCF messages, so I think you simply have to write MQ code to build PCF messages in C#.

That is, you construct an MQMessage object and use the various MQC Constants to write the necessary fields into the message until you've constructed a PCF message. You can look at the various PCF samples, including the C sample, to see what fields to build and in what order.

Then you can consult the link I posted to the Inquire Q Names command, in the MQ 75 info center, to understand the message you need to construct.
Back to top
View user's profile Send private message
gbaddeley
PostPosted: Tue Jul 02, 2013 3:39 pm    Post subject: Reply with quote

Jedi

Joined: 25 Mar 2003
Posts: 2495
Location: Melbourne, Australia

Quote:
But why do you feel obligated to limit me like this? What if I want to write my very own admin tool? What if I want to start my own software development company and specialize in developing and providing tools for MQ Admins, and so on?

You are quite welcome to do that, and I wish you the best success. I was just giving a heads up to a new poster on mqseries.net that you are venturing into deep water, and your requirement might have been satisfied by existing tools or well established MQ design techniques.
Quote:
Please somebody point me to a resource that tells me how to use PCF with .NET C# !! Prefereably a resource that deals with at least MQ v7.

Sorry, I haven't used PCF in .NET C#, and I don't know if PCF message classes are available for .NET C#. You could always roll your own, it is not too difficult if you like technical challenges!
_________________
Glenn
Back to top
View user's profile Send private message
shashikanth_in
PostPosted: Wed Jul 03, 2013 3:16 am    Post subject: PCF classes in MQ .NET Reply with quote

Centurion

Joined: 26 Feb 2009
Posts: 123

There is certain level of PCF support in MQ .NET classes. There is IBM.WMQ.PCF namespace that can be used to run PCF commands but it is undocumented and have not been updated since MQ v7. So some attributes/data types may not work.

You can refer to PCF classes documentation in MQ Java for help.

Here is snippet for inquiring local queue names in a queue manager:

Code:
        public void InquireQueues()
        {
            try
            {
                PCFMessageAgent messageAgent = new PCFMessageAgent("QM");

                PCFMessage pcfMsg = new PCFMessage(MQC.MQCMD_INQUIRE_Q);
                pcfMsg.AddParameter(MQC.MQCA_Q_NAME, "*");
                pcfMsg.AddParameter(MQC.MQIA_Q_TYPE, MQC.MQQT_LOCAL ) ;

                PCFMessage[] pcfResponse = messageAgent.Send(pcfMsg);
                int pcfResponseLen = pcfResponse.Length;

                for (int pcfResponseIdx = 0; pcfResponseIdx < pcfResponseLen; pcfResponseIdx++)
                {
                    PCFParameter[] parameters = pcfResponse[pcfResponseIdx].GetParameters();
                    foreach (PCFParameter pm in parameters)
                    {
                        Console.WriteLine(pm.Parameter + " - " + pm.GetValue());
                    }
                }
                messageAgent.Disconnect();
            }
            catch (MQException ex)
            {
                Console.Write(ex);
            }
        }
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 API Support » How to retrieve names of objects in a queue manager
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.