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 » CurrentDepth for an Alias Queue?

Post new topic  Reply to topic Goto page 1, 2  Next
 CurrentDepth for an Alias Queue? « View previous topic :: View next topic » 
Author Message
cmkeller
PostPosted: Thu May 27, 2010 1:25 pm    Post subject: CurrentDepth for an Alias Queue? Reply with quote

Apprentice

Joined: 09 Jan 2005
Posts: 41
Location: Queens, NY

Is it possible to use the "CurrentDepth" function for an alias queue? I get an error "MQRC_SELECTOR_NOT_FOR_TYPE" when I try, though I did open the queue with the MQOO_INQUIRE option. Am I missing an option, or is it just not doable?
_________________
Chaim Mattis Keller
Shadow Financial Services Corp
ckeller@shadowfinancial.com
Back to top
View user's profile Send private message Send e-mail
wschutz
PostPosted: Thu May 27, 2010 1:29 pm    Post subject: Reply with quote

Jedi Knight

Joined: 02 Jun 2005
Posts: 3316
Location: IBM (retired)

No, but you get get the base queue (target q) name and maybe get its depth.
_________________
-wayne
Back to top
View user's profile Send private message Send e-mail AIM Address
Vitor
PostPosted: Thu May 27, 2010 1:29 pm    Post subject: Re: CurrentDepth for an Alias Queue? Reply with quote

Grand High Poobah

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

cmkeller wrote:
is it just not doable?


It's just not doable. An Alias queue has no depth.

You can, with a little ingenuity, find the base queue the alias points to and enquire on the depth of that. This may or may not meet your needs.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
wschutz
PostPosted: Thu May 27, 2010 1:37 pm    Post subject: Reply with quote

Jedi Knight

Joined: 02 Jun 2005
Posts: 3316
Location: IBM (retired)

Of course, that assumes the alias is pointing to a local queue and not a remote q.....
_________________
-wayne
Back to top
View user's profile Send private message Send e-mail AIM Address
Vitor
PostPosted: Thu May 27, 2010 1:37 pm    Post subject: Reply with quote

Grand High Poobah

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

wschutz wrote:
Of course, that assumes the alias is pointing to a local queue and not a remote q.....


Good point!!!
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
bruce2359
PostPosted: Thu May 27, 2010 1:48 pm    Post subject: Reply with quote

Poobah

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

The only type of queue that can have messages (and therefore queue depth) is a QLOCAL. The other types of queue definitions are just that - definitions that resolve to local queues.

An alias definition can point to a local queue or to a remote definition. A remote definition can point to a local transmission queue. A model definition resolves to a dynamically created local queue.

It is unfortunate that the documentation refers to aliases and remote definitions as queues, for they are not.
_________________
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
wschutz
PostPosted: Thu May 27, 2010 1:55 pm    Post subject: Reply with quote

Jedi Knight

Joined: 02 Jun 2005
Posts: 3316
Location: IBM (retired)

bruce2359 wrote:
It is unfortunate that the documentation refers to aliases and remote definitions as queues, for they are not.
Well, if I can get/put messages to it, that makes it a queue...
_________________
-wayne
Back to top
View user's profile Send private message Send e-mail AIM Address
fatherjack
PostPosted: Thu May 27, 2010 2:05 pm    Post subject: Reply with quote

Knight

Joined: 14 Apr 2010
Posts: 522
Location: Craggy Island

wschutz wrote:
Well, if I can get/put messages to it, that makes it a queue...


But you can't get messages from a remote queue so what does that make it
_________________
Never let the facts get in the way of a good theory.
Back to top
View user's profile Send private message
wschutz
PostPosted: Thu May 27, 2010 2:45 pm    Post subject: Reply with quote

Jedi Knight

Joined: 02 Jun 2005
Posts: 3316
Location: IBM (retired)

fatherjack wrote:
wschutz wrote:
Well, if I can get/put messages to it, that makes it a queue...


But you can't get messages from a remote queue so what does that make it
Half-a-queue?
_________________
-wayne
Back to top
View user's profile Send private message Send e-mail AIM Address
fatherjack
PostPosted: Thu May 27, 2010 2:58 pm    Post subject: Reply with quote

Knight

Joined: 14 Apr 2010
Posts: 522
Location: Craggy Island

wschutz wrote:
Half-a-queue?


Maybe, but at this time of night after what I've had to drink I'm queueless
_________________
Never let the facts get in the way of a good theory.
Back to top
View user's profile Send private message
mqjeff
PostPosted: Fri May 28, 2010 1:54 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

wschutz wrote:
bruce2359 wrote:
It is unfortunate that the documentation refers to aliases and remote definitions as queues, for they are not.
Well, if I can get/put messages to it, that makes it a queue...


Only if the messages are returned in queue-order, rather than stack-order or random-order or other such.

FIFO for life...
Back to top
View user's profile Send private message
rmalghan
PostPosted: Wed Nov 17, 2010 6:53 am    Post subject: Re: CurrentDepth for an Alias Queue? Reply with quote

Newbie

Joined: 09 May 2008
Posts: 8

cmkellr: did you ever figure this one out. I am trying to figure this out and have not had much luck. If I use the local/base quename, the script I have does return the que depth. But if I use a alias que, I can't seem to figure out how to get the local que name.
Code:

MQEnvironment.properties.put(MQC.TRANSPORT_PROPERTY,MQC.TRANSPORT_MQSERIES);
qMgr = new MQQueueManager(qManager);
int openOptions = MQC.MQOO_INQUIRE + MQC.MQOO_FAIL_IF_QUIESCING + MQC.MQOO_INPUT_AS_Q_DEF;
MQQueue system_default_local_queue =qMgr.accessQueue(inputQName,openOptions,null,null,null);
int msgText =  system_default_local_queue.getCurrentDepth();

cmkeller wrote:
Is it possible to use the "CurrentDepth" function for an alias queue? I get an error "MQRC_SELECTOR_NOT_FOR_TYPE" when I try, though I did open the queue with the MQOO_INQUIRE option. Am I missing an option, or is it just not doable?
Back to top
View user's profile Send private message
mqjeff
PostPosted: Wed Nov 17, 2010 7:00 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

You do not ever ever ever want to inquire on queue depth from within an application performing business logic.

If you are doing anything to try to find out how many messages need to be processed, or whether or not the queue will be full if you put a message, then you are doing entirely the wrong thing and need to go back to your MQ application programming training materials and review.

If you are trying to roll your own monitoring application, then you shouldn't be dealing with alias queues in the first place, you should be only working with qlocals by only asking for qlocals.
Back to top
View user's profile Send private message
rmalghan
PostPosted: Wed Nov 17, 2010 7:11 am    Post subject: Reply with quote

Newbie

Joined: 09 May 2008
Posts: 8

Here's my situation. I have a IBM application (client) which connects to MQ and picks up messages. Occasionally something happens which causes the application to stop picking up the messages (for example last weekend MQ server crashed and we had to manually restart the listeners when the MQ came back up). So I was trying to monitor the que depth outside of the client application and if I see the que depth above a certain threshold, automatically restart the client listeners. I know I need to work with the client developers to address this issue of not reconnecting when there are issues. But from operational stand point, I need to ensure the que depth is never above a certain threshold.

So I built this script which checks the que depth every 20-30 minutes. It works if I provide the local que name. My MQ admin is saying they will not expose the local que name since it might change. They are telling me to use the alias quename and find the local que name within the script.

Thanks
Ravi
mqjeff wrote:
You do not ever ever ever want to inquire on queue depth from within an application performing business logic.

If you are doing anything to try to find out how many messages need to be processed, or whether or not the queue will be full if you put a message, then you are doing entirely the wrong thing and need to go back to your MQ application programming training materials and review.

If you are trying to roll your own monitoring application, then you shouldn't be dealing with alias queues in the first place, you should be only working with qlocals by only asking for qlocals.
Back to top
View user's profile Send private message
mqjeff
PostPosted: Wed Nov 17, 2010 7:19 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

You can write a PCF command to inquire about the QALIAS and then examine the TARGQ parameter to find out the real name. You can then inquire about the real queue.

But your MQ admins probably already have a tool that can monitor the queue depth and generate an alert or take an action - like restarting your listeners.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Goto page 1, 2  Next Page 1 of 2

MQSeries.net Forum Index » IBM MQ API Support » CurrentDepth for 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.