Author |
Message
|
remarbach |
Posted: Mon Aug 25, 2008 10:53 am Post subject: How to get Q depth of MQ Queue into message flow |
|
|
Novice
Joined: 15 Feb 2002 Posts: 12 Location: Kaiser
|
Hi ALL
We are running WMB 6.0.2. We would like to create a message flow that takes a message off a queue, reads a queue name from the incoming message, go out and get the current queue depth of this queue and place this number into the body of the message and send it on.
Is this possible in 6.0.2 ? If so, what would be the approach?
TIA
Randt |
|
Back to top |
|
 |
fjb_saper |
Posted: Mon Aug 25, 2008 11:00 am Post subject: Re: How to get Q depth of MQ Queue into message flow |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
remarbach wrote: |
Hi ALL
We are running WMB 6.0.2. We would like to create a message flow that takes a message off a queue, reads a queue name from the incoming message, go out and get the current queue depth of this queue and place this number into the body of the message and send it on.
Is this possible in 6.0.2 ? If so, what would be the approach?
TIA
Randt |
Look into support pack MS0B  _________________ MQ & Broker admin |
|
Back to top |
|
 |
PeterPotkay |
Posted: Mon Aug 25, 2008 11:15 am Post subject: Re: How to get Q depth of MQ Queue into message flow |
|
|
 Poobah
Joined: 15 May 2001 Posts: 7722
|
remarbach wrote: |
We are running WMB 6.0.2. We would like to create a message flow that takes a message off a queue, reads a queue name from the incoming message, go out and get the current queue depth of this queue and place this number into the body of the message and send it on.
|
I'm curious why you want to do this. You do realize that there are a number of reasons where the current q depth is not equal to the number of messages on the queue. Aside from that, 1 millisecond after you record the q depth, inaccurate as it may be in relation to available messages, its possible that number can go up or down, maybe significantly. _________________ Peter Potkay
Keep Calm and MQ On |
|
Back to top |
|
 |
remarbach |
Posted: Mon Aug 25, 2008 5:28 pm Post subject: Re: How to get Q depth of MQ Queue into message flow |
|
|
Novice
Joined: 15 Feb 2002 Posts: 12 Location: Kaiser
|
PeterPotkay wrote: |
I'm curious why you want to do this. You do realize that there are a number of reasons where the current q depth is not equal to the number of messages on the queue. Aside from that, 1 millisecond after you record the q depth, inaccurate as it may be in relation to available messages, its possible that number can go up or down, maybe significantly. |
We have some scripts written in perl (using the MQSeries perl modules) that look at a list of queues .... for each queue in the list we want to see what the current qdepth or age is. Then based on the value of some configuration parameters for each queue, we will send an email to an operator to check the status of the application reading from the queue, if the depth is greater than the config value. We are looking at reimplementing this functionality in WMB 6. |
|
Back to top |
|
 |
sunny_30 |
Posted: Mon Aug 25, 2008 7:38 pm Post subject: |
|
|
 Master
Joined: 03 Oct 2005 Posts: 258
|
you can write a simple external-java-procedure to enquire the qdepth.
if ur using esql:
the ext-java procedure can be called the below way:
EXAMPLE:
Code: |
CREATE FUNCTION QueueDepth(IN qmanager CHAR, IN queue CHAR) RETURNS INTEGER
LANGUAGE JAVA
EXTERNAL NAME "QueueDepth.getQueueDepth"; |
//sunny |
|
Back to top |
|
 |
TJParsons |
Posted: Thu Sep 04, 2008 8:07 am Post subject: |
|
|
Newbie
Joined: 19 Jun 2007 Posts: 3 Location: Winchester, UK
|
sunny_30 wrote: |
you can write a simple external-java-procedure to enquire the qdepth. |
sunny,
Are you aware of any documentation on writing such java procedures? (esp in regard to using the MQ libraries) I have a similar requirement but have never accessed MQ info from java before. |
|
Back to top |
|
 |
mqmatt |
Posted: Fri Sep 05, 2008 2:48 am Post subject: |
|
|
 Grand Master
Joined: 04 Aug 2004 Posts: 1213 Location: Hursley, UK
|
|
Back to top |
|
 |
|