Author |
Message
|
kusanagi |
Posted: Fri Nov 04, 2005 7:52 am Post subject: List two specific queues from a qmanager. |
|
|
Newbie
Joined: 04 Nov 2005 Posts: 4
|
I try to list 2 specific queues from a qmanager, but i receive a RC = 2305, can someone help me?. (queue exist in qmanager)
I use this:
mqCreateBag MQCBO_ADMIN_BAG, QueueBag, CompCode, reason
mqAddString QueueBag, MQCA_Q_NAME, MQBL_NULL_TERMINATED, "QUEUE1", CompCode, reason
mqAddString QueueBag, MQCA_Q_NAME, MQBL_NULL_TERMINATED, "QUEUE2", CompCode, reason
mqAddInteger QueueBag, MQIA_Q_TYPE, MQQT_LOCAL, CompCode, reason
mqExecute Hconn, MQCMD_INQUIRE_Q, MQHB_NONE, QueueBag, ResponseBag, CMQB.MQHO_NONE, CMQB.MQHO_NONE, CompCode, reason
I receive a RC 2305 in mqExecute.
Thanks. |
|
Back to top |
|
 |
kevinf2349 |
Posted: Fri Nov 04, 2005 8:09 am Post subject: |
|
|
 Grand Master
Joined: 28 Feb 2003 Posts: 1311 Location: USA
|
You haven't set your bags up correctly.
Actually I am not 100% sure that you can do two at once....but I could well be wrong.
I would personally do them seperately. |
|
Back to top |
|
 |
kusanagi |
Posted: Fri Nov 04, 2005 8:18 am Post subject: |
|
|
Newbie
Joined: 04 Nov 2005 Posts: 4
|
My list of queues is very big.
do them seperately maybe too expensive. |
|
Back to top |
|
 |
wschutz |
Posted: Fri Nov 04, 2005 8:22 am Post subject: |
|
|
 Jedi Knight
Joined: 02 Jun 2005 Posts: 3316 Location: IBM (retired)
|
Well, you could try:
Code: |
mqAddString QueueBag, MQCA_Q_NAME, MQBL_NULL_TERMINATED, "QUEUE*", CompCode, reason |
Tell us what your are trying to do, perhaps there are other solutions. _________________ -wayne |
|
Back to top |
|
 |
kevinf2349 |
Posted: Fri Nov 04, 2005 8:28 am Post subject: |
|
|
 Grand Master
Joined: 28 Feb 2003 Posts: 1311 Location: USA
|
Quote: |
My list of queues is very big. |
Quote: |
I try to list 2 specific queues |
2 isn't that big! |
|
Back to top |
|
 |
kusanagi |
Posted: Fri Nov 04, 2005 8:34 am Post subject: |
|
|
Newbie
Joined: 04 Nov 2005 Posts: 4
|
wschutz wrote: |
Well, you could try:
Code: |
mqAddString QueueBag, MQCA_Q_NAME, MQBL_NULL_TERMINATED, "QUEUE*", CompCode, reason |
Tell us what your are trying to do, perhaps there are other solutions. |
Ok, i try to detail my program.
I have a program, that read from ini file a list of queues for monitoring. The list contains diferents names of queues, for example:
"Queue1"
"DATA.QL.REQUEST"
"ACLARACION"
A know the method: "*" and "Queue*".
I find in the net, concepts like INDEX, SELECTOR, but i dont understand yet.
Thanks for all your responses. |
|
Back to top |
|
 |
kevinf2349 |
Posted: Fri Nov 04, 2005 8:44 am Post subject: |
|
|
 Grand Master
Joined: 28 Feb 2003 Posts: 1311 Location: USA
|
Why not get a list of all queues and then filter out the ones you want from that? |
|
Back to top |
|
 |
kusanagi |
Posted: Fri Nov 04, 2005 8:53 am Post subject: |
|
|
Newbie
Joined: 04 Nov 2005 Posts: 4
|
yes, i think in that, but i prefer a fast code, obtain only the requested queues. |
|
Back to top |
|
 |
wschutz |
Posted: Fri Nov 04, 2005 8:59 am Post subject: |
|
|
 Jedi Knight
Joined: 02 Jun 2005 Posts: 3316 Location: IBM (retired)
|
It depends on the ratio of queues that are returned from querying "*" versus the total number of queues in the system. If you're interested in 90% of the total queues, then it makes sense to make one request with the "*" and get lots of responses back, and then filter thru them. If you're interested in 10% of the queues, make individual requests.
In any case, have you done any timings to know that any one method would be too slow? _________________ -wayne |
|
Back to top |
|
 |
kevinf2349 |
Posted: Fri Nov 04, 2005 9:57 am Post subject: |
|
|
 Grand Master
Joined: 28 Feb 2003 Posts: 1311 Location: USA
|
It will also depend onthe naming conventions that are in place. If you have all the 'queue of interest' start with different characters you could be in for a world of hurt, but if name them all with the same starting characteristics it may be simpler. ie 'LIST.*' or whatever is better than 'A.LIST', 'B.LIST', 'AB.DONTLIST' |
|
Back to top |
|
 |
wschutz |
Posted: Fri Nov 04, 2005 10:04 am Post subject: |
|
|
 Jedi Knight
Joined: 02 Jun 2005 Posts: 3316 Location: IBM (retired)
|
Quote: |
The list contains diferents names of queues, for example:
"Queue1"
"DATA.QL.REQUEST"
"ACLARACION"
|
Looks like a world of hurt  _________________ -wayne |
|
Back to top |
|
 |
kevinf2349 |
Posted: Fri Nov 04, 2005 10:46 am Post subject: |
|
|
 Grand Master
Joined: 28 Feb 2003 Posts: 1311 Location: USA
|
Wayne
Yep, sure does. I must have had a brain fart to miss that.
I still think he would better better off getting them all and filtering from there....but like you say it really depends on the numbers involved....of course he could just download QFLEX and not even bother to write his/her own monitor.
 |
|
Back to top |
|
 |
jefflowrey |
Posted: Fri Nov 04, 2005 10:59 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
I guess I'm wondering why kusanagi wants to "list" queues, when kusanagi already has a list of queues.
I'd think that the proper course of action is to decide what steps need to be done to "monitor" a queue - queue status? dis queue? - and then do those steps for each queue in the list.
A multi-threaded model could be used to decrease the time between when a particular queue is looked at, and when it is looked at next. Perhaps one thread per QM in question, or one thread per 10 queues per QM in question or etc.
There may, in fact, be a much better way (like event messages) to perform the "monitoring" that kusanagi actually wants to do as well. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
kevinf2349 |
Posted: Fri Nov 04, 2005 12:02 pm Post subject: |
|
|
 Grand Master
Joined: 28 Feb 2003 Posts: 1311 Location: USA
|
Jeff
Quote: |
I guess I'm wondering why kusanagi wants to "list" queues, when kusanagi already has a list of queues.
|
Maybe he wants to validate that the queues in his list actually exist?
I guess only kusanagi knows for sure, but that is the only reason I could think of.
Sounds like a case of wheel reinventing to me  |
|
Back to top |
|
 |
|