Author |
Message
|
klamerus |
Posted: Sun Feb 27, 2005 10:44 am Post subject: Need Sample |
|
|
 Disciple
Joined: 05 Jul 2004 Posts: 199 Location: Detroit, MI
|
We are using MQ on Windows. We have several programs that read messages from these and do work. These are written in Visual C/C++.
Sometimes these get stuck, but they don't actually die, so our server process monitoring doesn't tell us.
We understand that we can look at queue statistics and through that see how many messages are getting processed off the queues. We could then have this program check (say every 5 minutes) to see how much work has flown through one or more of these other queues.
Does anyone have any code snippets that would show how to do tihs? We'll even send some funds via paypal if necessary. |
|
Back to top |
|
 |
jefflowrey |
Posted: Sun Feb 27, 2005 11:07 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
There's plenty of sample code available that shows how to create PCF messages using a variety of languages.
RESET QUEUE STATISTICS is a PCF command, as is INQUIRE QUEUE STATUS, which can return you CURRENT_Q_DEPTH.
These are documented in the PCF command manual.
But if you have a need to monitor MQ systems and software, you may be better off buying a solution rather than writing your own - depending on the size of your infrastructure and the requirements that need to be met. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
klamerus |
Posted: Sun Feb 27, 2005 4:00 pm Post subject: Looking for tools |
|
|
 Disciple
Joined: 05 Jul 2004 Posts: 199 Location: Detroit, MI
|
We're already looking at tools, but haven't found one we like yet.
We also need to be able integrate these queries on activity into our internal monitoring tool, SiteScope. This can call custom code to return information to our centralized monitoring tool.
So, we need to be able to query for this from a program (not command-line) and determine activity.
We are already able to look at queue depth, but the depth can grow even if our programs are working fine (because they can take a while to do their work). |
|
Back to top |
|
 |
fjb_saper |
Posted: Mon Feb 28, 2005 11:08 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
jefflowrey wrote: |
But if you have a need to monitor MQ systems and software, you may be better off buying a solution rather than writing your own - depending on the size of your infrastructure and the requirements that need to be met. |
I couldn't agree more with Jeff. Seems that all that's left to do is for you to build a case for it.
Have fun  |
|
Back to top |
|
 |
klamerus |
Posted: Mon Feb 28, 2005 4:50 pm Post subject: We have an enterprise monitoring tool. |
|
|
 Disciple
Joined: 05 Jul 2004 Posts: 199 Location: Detroit, MI
|
We have an enterprise monitoring tool. That's SiteScope. We want to tie this checking into it. It's got the ability to monitor queue depth already, and we're doing that. We just want to add this statistics thing. In other words, we're 3/4ths of the way there. Knowing that there's an API and that we have a tool monitoring these other items, and that the tool can call an API, nobody at this company is going to approve buying a new, non-standard tool. I just need some sample code to tie in this last bit.
The examples people have provided all look like command-line. Is that the only way to find this information out. |
|
Back to top |
|
 |
RogerLacroix |
Posted: Mon Feb 28, 2005 6:31 pm Post subject: |
|
|
 Jedi Knight
Joined: 15 May 2001 Posts: 3264 Location: London, ON Canada
|
Hi,
Go get the qstatus sample program at IBM Developer web site and change the request from queue attributes to queue reset stats. et voila.
Regards,
Roger Lacroix _________________ Capitalware: Transforming tomorrow into today.
Connected to MQ!
Twitter |
|
Back to top |
|
 |
malammik |
Posted: Mon Feb 28, 2005 7:03 pm Post subject: |
|
|
 Partisan
Joined: 27 Jan 2005 Posts: 397 Location: Philadelphia, PA
|
|
Back to top |
|
 |
RogerLacroix |
Posted: Mon Feb 28, 2005 7:15 pm Post subject: |
|
|
 Jedi Knight
Joined: 15 May 2001 Posts: 3264 Location: London, ON Canada
|
malammik,
I realize that you are excited about your new toy but 'klamerus' requirement is NOT to replace their existing enterprise tool but enhance it.
Regards,
Roger Lacroix _________________ Capitalware: Transforming tomorrow into today.
Connected to MQ!
Twitter |
|
Back to top |
|
 |
malammik |
Posted: Mon Feb 28, 2005 7:31 pm Post subject: |
|
|
 Partisan
Joined: 27 Jan 2005 Posts: 397 Location: Philadelphia, PA
|
|
Back to top |
|
 |
kevinf2349 |
Posted: Mon Feb 28, 2005 8:31 pm Post subject: |
|
|
 Grand Master
Joined: 28 Feb 2003 Posts: 1311 Location: USA
|
malammik
I disagree with you. I don't believe that Roger was being "rude and hostile" I believe he was trying to refocus people onto what the original poster actually wants...which is sample code to do some qstats stuff. The original poster stated that he/she doesn't want to replace their current tool (SiteScope), rather they want to add that little bit extra to what is already in place.
I have little doubt that there are many good points in your software and that it has a place in the MQ world, but sometimes people just need to have some crossover features that don't require a full 'product' to be able to achieve their objective.
Just my humble.  |
|
Back to top |
|
 |
klamerus |
Posted: Tue Mar 01, 2005 3:25 am Post subject: Good Tools |
|
|
 Disciple
Joined: 05 Jul 2004 Posts: 199 Location: Detroit, MI
|
I've found a number of good tools. The malammik pointed out one, but other posters here in other groups also pointed out others. They're all quite nice, just not what we need. I'm going to have to see if I can find that sample. It sounds like it will hit the mark.
I'm confused though. It sounds like this command is attempting to reset something in the queue, not what I thought I'd read in another posting, which is to count messages delivered to programs in a time period. Is the mechanism to reset the count of messages delivered, and then read how many new ones were delivered? We don't want to "flush" the queues, which still have thousands of jobs in them. |
|
Back to top |
|
 |
klamerus |
Posted: Tue Mar 01, 2005 3:34 am Post subject: Toast |
|
|
 Disciple
Joined: 05 Jul 2004 Posts: 199 Location: Detroit, MI
|
Okay, so now I'm toasted. .
I'm at IBM Developerworks having no luck finding any sample code on WMQ. Does anyone have a url to somewhere in the site (or anywhere else including elsewhere in this forum)? |
|
Back to top |
|
 |
vmcgloin |
Posted: Tue Mar 01, 2005 4:24 am Post subject: |
|
|
Knight
Joined: 04 Apr 2002 Posts: 560 Location: Scotland
|
|
Back to top |
|
 |
jefflowrey |
Posted: Tue Mar 01, 2005 5:39 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
The RESET QUEUE STATISTICS command does just that. It resets MQ's internal counters of how many messages have gone onto that queue, and returns the number since the last reset. In other words, MQ is counting the messages that go into the queue over time, and returning that number to you. But it's a reset mechanism, not a query mechanism.
This means that if you want to track your queue depth with a resolution of five minutes, you have to issue the reset queue stats command every five minutes. Likewise, for a 30 second interval, you need to issue the command every 30 seconds.
The advantage of this over Queue depth is the fact that it is an "over time" measure, rather than a "point in time" measure. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
PeterPotkay |
Posted: Tue Mar 01, 2005 5:02 pm Post subject: |
|
|
 Poobah
Joined: 15 May 2001 Posts: 7722
|
klamerus,
Regardless of your outcome, complain to Mercury SiteScope that their MQ monitor is lacking features. This lack (among others, like lacking z/OS support) are reasons we chose not to have Sitescope be our MQ monitoring tool, even though Sitescope is going to be our Enterprise Monitor tool for just about everything else.
Good luck with getting the queue statistics working. Maybe if your company is influential enough, you can push Mercury to do this enhancement for you in their product. _________________ Peter Potkay
Keep Calm and MQ On |
|
Back to top |
|
 |
|