Author |
Message
|
anveshita |
Posted: Wed Dec 15, 2004 7:58 am Post subject: Queue monitor |
|
|
Master
Joined: 27 Sep 2004 Posts: 254 Location: Jambudweepam
|
I am trying to develop an application in Java.
The application need to monitor tw three queues.
For each queue, it need to do the following:
1. Check if the queue depth is 1000, create a record
in a database table with date time stamp
2. Then check again the depth, see if it is 2000, then
create another record in the database table with date time
stamp.
Please let me know how I can do this?
Do I have to use performance events for this?
Please give me some directions to notes, code samples etc.. |
|
Back to top |
|
 |
vennela |
Posted: Wed Dec 15, 2004 8:26 am Post subject: |
|
|
 Jedi Knight
Joined: 11 Aug 2002 Posts: 4055 Location: Hyderabad, India
|
It is not easy I think
You have to use a combination of triggering on DEPTH and events on QDEPTHs
If you use performance events then you can generate events for 2000.
Use triggering on DEPTH for 1000. |
|
Back to top |
|
 |
kirani |
Posted: Wed Dec 15, 2004 12:27 pm Post subject: |
|
|
Jedi Knight
Joined: 05 Sep 2001 Posts: 3779 Location: Torrance, CA, USA
|
Triggering and Event Messages will help if there is some application doing MQGET on the queue. Can you explain more about this requirement? Do you want to log one message in DB table for every 1000 messages that come on the queue?
I guess you can use MQINQ call to get the queue depth and then do your processing for every 1000 message. _________________ Kiran
IBM Cert. Solution Designer & System Administrator - WBIMB V5
IBM Cert. Solutions Expert - WMQI
IBM Cert. Specialist - WMQI, MQSeries
IBM Cert. Developer - MQSeries
|
|
Back to top |
|
 |
fjb_saper |
Posted: Wed Dec 15, 2004 3:38 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
Depending on need and budget you can have some monitoring app do it for you. We use QPasa but they are usually all up to this kind of task.
Enjoy  |
|
Back to top |
|
 |
anveshita |
Posted: Thu Dec 16, 2004 5:25 am Post subject: |
|
|
Master
Joined: 27 Sep 2004 Posts: 254 Location: Jambudweepam
|
Thanks Vennela,
The one suggested above is a "Trigger type" application.
Kirani,
Yes while my application is monitoring the queue, another application ( which I think can not alter) ICS is reading the messages.
Now if I have different plan.
I would write a program that continuously runs. I will have a
properties file in which I mention which queues to monitor and at
what frequency. Say the program checks the depth of queue1 and queue2 every sec.
The queues queue1 and queue2 are application specific queues and while
my program is monitoring the queue depth, another program reads/checks out the messages from the queue.It is not a true representation of the queue depth as the messages are getting drained while I am trying to make a note of the messages.
But, I guess its OK.
Now, my question is can my program take the depth of a queue when another program is trying to read the messages from the queue. If so, what options I should be using.
Any suggestions,code samples
Thanks
Also, I can not buy QPasa for this |
|
Back to top |
|
 |
kevinf2349 |
Posted: Thu Dec 16, 2004 5:37 am Post subject: |
|
|
 Grand Master
Joined: 28 Feb 2003 Posts: 1311 Location: USA
|
Every second? Goodness that seems like it would be a tight loop. I thought you only wanted to know when it reached 1000, then 2000? Even with the best will in the world that means you are going to be 'missing' more often than 'hitting'.
Why not just trigger on a depth of 1000 and then have that triggered application change the trigger depth value of the 'monitored' queue to 2000?. You will have to reset the trigger attribute anyway after a depth 'pop'...of course you are left with the problem of what happens when the depth decreases below 1000 again but you will have that no matter what.
What is the actual purpose of the monitor? I know you said it was to write a database record when the depth reaches 1000 and then 2000 but to what end? What if the queue depth drops to 999 one second and back to 1000 many times over a short period of time? What is the message throughput rate currently? Couldn't you use MO71 with auto-update on the queue display for the queue if you are simply wanting to 'keep an eye on it'?
I guess I must be missing the whole point of this monitor.  |
|
Back to top |
|
 |
jefflowrey |
Posted: Thu Dec 16, 2004 5:43 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
I must really be missing something.
If another program, especially ICS, is running and reading from the queue, then the queue depth should likely NEVER get to 1000. Unless you have a serious performance backlog with your process, or you have a seriously high volume application feeding messages in...
Are you trying to count the total number of messages that go through a queue?
You can't do that with Queue Depth. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
kevinf2349 |
Posted: Thu Dec 16, 2004 5:48 am Post subject: |
|
|
 Grand Master
Joined: 28 Feb 2003 Posts: 1311 Location: USA
|
Hmmmmm If something has the queue open for input then triggering on depth won't take place anyway. One of the requirements for triggering on depth (or first) to take place is that no program had the queue open for input? So depth triggering is moot anyway in that case. |
|
Back to top |
|
 |
bower5932 |
Posted: Thu Dec 16, 2004 6:13 am Post subject: |
|
|
 Jedi Knight
Joined: 27 Aug 2001 Posts: 3023 Location: Dallas, TX, USA
|
What about using the PCF Reset Queue Statistics? It sounds like you want to know what has gone through the queue rather than on the queue. You could have your program run every hour and report results. |
|
Back to top |
|
 |
pgorak |
Posted: Thu Dec 16, 2004 7:25 am Post subject: |
|
|
 Disciple
Joined: 15 Jul 2002 Posts: 158 Location: Cracow, Poland
|
I found PCF Statistics VERY useful in a similar case. I had to log things like QDEPTH and PUTs and GETs per second on dozen of queues... without any commercial tool well, it worked fine.
Piotr _________________ ***
IBM Certified Solution Developer WebSphere MQ 5.3 |
|
Back to top |
|
 |
anveshita |
Posted: Thu Dec 16, 2004 8:46 am Post subject: |
|
|
Master
Joined: 27 Sep 2004 Posts: 254 Location: Jambudweepam
|
Again if I have confused you all.. I apologize.
This is my requirement
I have an ICS application ( I can not change it as it ismaintained by other team) that reads the messages from queue1.
I am asked to develop an application that monitors the queue1. I need to write a message in a database table
with datetime stamp whenever the queue depth reaches certain numbers say 1000,2000,3000.
I am asked to make this more generic so that I could monitor multiple queues with multiple target queue depths.
The broad perspective I was given so far was that the messages I would put , would in turn
send an e-mail to somebody's cellphone.
I wish I could have a commercial product to do that.. but I am not at liberty.
pitorak,
<quote>I found PCF Statistics VERY useful in a similar case.</quote>
Can you please throw some light on this? What are PCF satitics ( is it performace events??)
Do you know of any sample code which I can take look at? |
|
Back to top |
|
 |
Nigelg |
Posted: Thu Dec 16, 2004 12:31 pm Post subject: |
|
|
Grand Master
Joined: 02 Aug 2004 Posts: 1046
|
How about setting the QDEPTHHI and QDEPTHLO percentages (of MAXDEPTH) on the queue to match your thresholds, and monitor the SYSTEM.ADMIN.EVENT.QUEUE, for example by using TRIGGER(EVERY), to read the depth events being written.
BTW, It is only TRIGGER(FIRST) which does not cause a trigger event when a queue is open for input; EVERY and DEPTH that condition is absent. |
|
Back to top |
|
 |
kevinf2349 |
Posted: Thu Dec 16, 2004 2:27 pm Post subject: |
|
|
 Grand Master
Joined: 28 Feb 2003 Posts: 1311 Location: USA
|
Hmmmmm Then the Application programming Guide needs to be changed
Chapter 14 states
Quote: |
For triggering of type FIRST or DEPTH, no program has the application queue open for removing messages (that is, the OpenInputCount local queue attribute is zero). |
|
|
Back to top |
|
 |
fjb_saper |
Posted: Thu Dec 16, 2004 3:30 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
I would go a little bit further and think about the purpose of this part.
a) you probably have a trigger on first on the app queue.
ICS is servicing it until empty and shuts down
b) you have a trigger every ICS is servicing on trigger
c) ICS is always servicing regardless....
If you have scenario a) or b) instead of just starting ICS start as well a little java APP. It should check QDepth Put rate and Get rate.
Now with that you can calculate how often you need to check. If the get rate stays at 0 more than 5 secs after the messages hit the queue (trigger) don't wait for one thousand messages, page. There is a problem as the messages aren't getting consumed....
Enjoy  |
|
Back to top |
|
 |
Nigelg |
Posted: Thu Dec 16, 2004 11:03 pm Post subject: |
|
|
Grand Master
Joined: 02 Aug 2004 Posts: 1046
|
Quote: |
It is only TRIGGER(FIRST) which does not cause a trigger event when a queue is open for input; EVERY and DEPTH that condition is absent. |
kevinf is right of course.
Quote: |
For triggering of type FIRST or DEPTH, no program has the application queue open for removing messages (that is, the OpenInputCount local queue attribute is zero). |
Sorry about that, I was quoting from memory (wrongly). I always have to look it up. Good job I do not have to take the test.
I still like my idea about the queue depth events though. |
|
Back to top |
|
 |
|