Author |
Message
|
thanigs |
Posted: Tue Jun 12, 2007 4:58 am Post subject: Problem in finding number of Queues |
|
|
Novice
Joined: 13 Dec 2005 Posts: 14
|
I am trying to get the number of queues using .NET and get message from them in a loop.
Can someone please help me in this regard if it is possible?
If yes, what function do we need to use?
Do we have any API for getting the number of queues in queue manager?
Thank You!
Regards,
Thanigs |
|
Back to top |
|
 |
jefflowrey |
Posted: Tue Jun 12, 2007 5:04 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
You don't want to read all messages from every queue on a queue manager.
You really don't.
You don't. Really, you don't.
You're really trying to jump way ahead on your learning curve, too. You should spend an hour or so reading the Application Programming Guide, or the MQ Primer.
You can get a list of queue names on a queue manager from a few different mechanisms - mainly either MQSC commands or PCF commands. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
Vitor |
Posted: Tue Jun 12, 2007 5:20 am Post subject: Re: Problem in finding number of Queues |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
thanigs wrote: |
I am trying to get the number of queues using .NET and get message from them in a loop.
|
What possible requirement would this meet?
Do you mean "get the number of messages on a queue and get them in a loop"?
This is an equally bad idea. Do not do that. Read the queue until there are no more messages. If you want to understand why, go through the forum; it's been discussed many times. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
kevinf2349 |
Posted: Tue Jun 12, 2007 5:26 am Post subject: Re: Problem in finding number of Queues |
|
|
 Grand Master
Joined: 28 Feb 2003 Posts: 1311 Location: USA
|
Vitor wrote: |
thanigs wrote: |
I am trying to get the number of queues using .NET and get message from them in a loop.
|
What possible requirement would this meet?
|
Just a SWAG but maybe to backup every message on the queue manager? .... but even so I agree with y'all .... bad idea!...nay...terrible idea!
If it is to backup the <b>busniess</b> messages then there much better methods (actually it would be hard to find a worse method) of doing this.
Maybe it was just a class exercise? Should be a pretty interesting mix of messages for output though especially when the SYSTEM queues are read!...better hope they are non-destructive reads too!  |
|
Back to top |
|
 |
Vitor |
Posted: Tue Jun 12, 2007 5:38 am Post subject: Re: Problem in finding number of Queues |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
kevinf2349 wrote: |
Maybe it was just a class exercise? Should be a pretty interesting mix of messages for output though especially when the SYSTEM queues are read!...better hope they are non-destructive reads too!  |
What class is that? "Driving your MQ Administrator mad for Developers"?  _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
Michael Dag |
Posted: Tue Jun 12, 2007 1:01 pm Post subject: Re: Problem in finding number of Queues |
|
|
 Jedi Knight
Joined: 13 Jun 2002 Posts: 2607 Location: The Netherlands (Amsterdam)
|
Vitor wrote: |
kevinf2349 wrote: |
Maybe it was just a class exercise? Should be a pretty interesting mix of messages for output though especially when the SYSTEM queues are read!...better hope they are non-destructive reads too!  |
What class is that? "Driving your MQ Administrator mad for Developers"?  |
ha... I always thought that's what you get by skipping any class on MQ  _________________ Michael
MQSystems Facebook page |
|
Back to top |
|
 |
jefflowrey |
Posted: Tue Jun 12, 2007 1:09 pm Post subject: Re: Problem in finding number of Queues |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
Michael Dag wrote: |
Vitor wrote: |
What class is that? "Driving your MQ Administrator mad for Developers"?  |
ha... I always thought that's what you get by skipping any class on MQ  |
Most MQ administrators get used to dealing with people who don't know anything about MQ. It's the one's that have special training in how NOT to use MQ that cause the trouble... At least, I assume *someone* must be teaching this class, and apparently for free.
I think the first thing they teach is how to forget what an MQRC means, so that you always have to ask the admin. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
thanigs |
Posted: Tue Jun 12, 2007 8:43 pm Post subject: |
|
|
Novice
Joined: 13 Dec 2005 Posts: 14
|
I totally agree with you all. But the requirement they gave me is that I need to write .net code through which I need to access each queue in queue manager in order and get messages from them.
Does it sound feasible? |
|
Back to top |
|
 |
jefflowrey |
Posted: Tue Jun 12, 2007 9:10 pm Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
No, it doesn't sound feasible.
There are a few queues that you *shouldn't* read, and at least one that you probably *can't* read.
There's also no real notion of an "order" of the queues. There's no numbers - this is the first queue, this is the second queue, etc... You could get the list of queue names, and go through those in alphabetical order, but that might not be correct.
And even if you've been given a requirement, you should find out what the *reason* for the requirement is. There's a real *business* requirement behind the technical requirement you've been given, and we're telling you that the technical requirement is very very bad. So find out what the business requirement is, and figure out a different technical way to meet it. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
thanigs |
Posted: Tue Jun 12, 2007 9:18 pm Post subject: |
|
|
Novice
Joined: 13 Dec 2005 Posts: 14
|
Thank you very much for your reply.
I'm in fact checking the real necessity with the corresponding team.
Is there a way using MQ classes for .net I can atleast get the list of queues? |
|
Back to top |
|
 |
Vitor |
Posted: Wed Jun 13, 2007 12:28 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
thanigs wrote: |
Is there a way using MQ classes for .net I can atleast get the list of queues? |
You'd need to create and submit a PCF command from your .NET application. This is something no application should need to do & is the function of an administrative program.
I can think of no good reason why an application would not be using a provided set of queue names. This is not to say someone else hasn't though of a reason, especially if they were not constrained by it being a "good" one!  _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
|