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 get the depth of an alias queue?

Post new topic  Reply to topic
 How to get the depth of an alias queue? « View previous topic :: View next topic » 
Author Message
bazooka
PostPosted: Tue Mar 31, 2009 10:59 pm    Post subject: How to get the depth of an alias queue? Reply with quote

Newbie

Joined: 31 Mar 2009
Posts: 3

hi guys, currently, i have this kind of issue, i can us MQC.MQOO_INQUIRE and CurrentDepth()to get the depth of the queue( which is a local queue)

but my program seems cannot work if the queue is a alias queue(the base is also a local queue)

any one knows why and how?

many thanks
Back to top
View user's profile Send private message
Mr Butcher
PostPosted: Wed Apr 01, 2009 1:13 am    Post subject: Reply with quote

Padawan

Joined: 23 May 2005
Posts: 1716

Quote:
any one knows why and how?


because it works as documented:

Quote:
If the object being inquired is an alias queue, the attribute values returned by the MQINQ call are those of the alias queue, and not those of the base queue to which the alias resolves.


(taken from the APR manual)
_________________
Regards, Butcher
Back to top
View user's profile Send private message
mqjeff
PostPosted: Wed Apr 01, 2009 2:11 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

Why are you writing a program to inquire the depth of a queue?
Back to top
View user's profile Send private message
zpat
PostPosted: Wed Apr 01, 2009 2:52 am    Post subject: Reply with quote

Jedi Council

Joined: 19 May 2001
Posts: 5866
Location: UK

Inquire on the base queue name attribute of the alias queue then open the base queue for inquire on queue depth (if you must).
Back to top
View user's profile Send private message
gbaddeley
PostPosted: Wed Apr 01, 2009 5:10 pm    Post subject: Reply with quote

Jedi Knight

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

mqjeff wrote:
Why are you writing a program to inquire the depth of a queue?


A nice leading question. One of my favourites. Tell us, bazooka. I can almost smell the answer.
_________________
Glenn
Back to top
View user's profile Send private message
bazooka
PostPosted: Wed Apr 01, 2009 5:41 pm    Post subject: Reply with quote

Newbie

Joined: 31 Mar 2009
Posts: 3

haha, i fixed, now i point to the local queue~~

well, I understand this is not a good way to write such a program. but user just request to do it like this...

they just want to use the depth to control the whole flow.....

which i told them, it's not a godo idea.
Back to top
View user's profile Send private message
bazooka
PostPosted: Wed Apr 01, 2009 5:43 pm    Post subject: Reply with quote

Newbie

Joined: 31 Mar 2009
Posts: 3

but thanks guys, you r cool~ really give me some good points:D
Back to top
View user's profile Send private message
kevinf2349
PostPosted: Wed Apr 01, 2009 6:47 pm    Post subject: Reply with quote

Grand Master

Joined: 28 Feb 2003
Posts: 1311
Location: USA

bazooka wrote:
haha, i fixed, now i point to the local queue~~

well, I understand this is not a good way to write such a program. but user just request to do it like this...

they just want to use the depth to control the whole flow.....

which i told them, it's not a godo idea.


Then trigger on depth...use the force Luke!
Back to top
View user's profile Send private message
gbaddeley
PostPosted: Thu Apr 02, 2009 4:50 pm    Post subject: Reply with quote

Jedi Knight

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

bazooka wrote:

well, I understand this is not a good way to write such a program. but user just request to do it like this...

they just want to use the depth to control the whole flow.....

which i told them, it's not a godo idea.


Be insistent and educate them about how to use MQ. If you let it go, you may regret it in the future.
_________________
Glenn
Back to top
View user's profile Send private message
Vitor
PostPosted: Thu Apr 02, 2009 10:50 pm    Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

bazooka wrote:
but user just request to do it like this...


Your user should provide a business requirement, not a technical solution.

bazooka wrote:
they just want to use the depth to control the whole flow.....

which i told them, it's not a godo idea.


Be sure to read up on the various discussions of this in the forum, so when the program doesn't work as they want you can explain why without having to research it. It'll make you look good.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
bruce2359
PostPosted: Fri Apr 03, 2009 8:12 am    Post subject: Reply with quote

Poobah

Joined: 05 Jan 2008
Posts: 9469
Location: US: west coast, almost. Otherwise, enroute.

Application developers not familiar with MQ concepts will assume that they must first determine if there is a message in the queue (MQINQ), and if there is a message, then MQGET the message. Two MQI calls when one would accomplish the same thing, namely: MQGET (with a WAIT - different discussion).

With one call: if there is a message in the queue, the call completes and returns a rc=0 (usually); if not, the call completes and returns a rc=2033 (no message available).

Two calls is twice the workload of one call (if my basic math skills have survived).
_________________
I like deadlines. I like to wave as they pass by.
ב''ה
Lex Orandi, Lex Credendi, Lex Vivendi. As we Worship, So we Believe, So we Live.
Back to top
View user's profile Send private message
Vitor
PostPosted: Fri Apr 03, 2009 9:07 am    Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

And of course there are those instances when the MQINQ call returns the wrong depth.....
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
bruce2359
PostPosted: Fri Apr 03, 2009 9:47 am    Post subject: Reply with quote

Poobah

Joined: 05 Jan 2008
Posts: 9469
Location: US: west coast, almost. Otherwise, enroute.

Quote:
returns the wrong depth...

Of course, MQINQ always returns the correct depth. The challenge for the developer is understanding what depth means at the precise instant when the MQINQ returned it.

Now, where did I leave those invisible messages...?
_________________
I like deadlines. I like to wave as they pass by.
ב''ה
Lex Orandi, Lex Credendi, Lex Vivendi. As we Worship, So we Believe, So we Live.
Back to top
View user's profile Send private message
Vitor
PostPosted: Fri Apr 03, 2009 10:09 am    Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

bruce2359 wrote:
Of course, MQINQ always returns the correct depth. The challenge for the developer is understanding what depth means at the precise instant when the MQINQ returned it.


Yes, yes, ok.
_________________
Honesty is the best policy.
Insanity is the best defence.
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 get the depth of an alias queue?
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.