Author |
Message
|
cots |
Posted: Tue Oct 19, 2004 7:15 am Post subject: Message Timing |
|
|
Centurion
Joined: 16 Jun 2003 Posts: 105
|
Hi all,
Pls advise,
I need to send an acknowledgement if the message stay in the queue for longer than 5 minutes. How do I do that?
Thanks in advance |
|
Back to top |
|
 |
PGoodhart |
Posted: Tue Oct 19, 2004 7:19 am Post subject: |
|
|
Master
Joined: 17 Jun 2004 Posts: 278 Location: Harrisburg PA
|
Buy a monitoring package?
I don't think you can do this with just MQ. _________________ Patrick Goodhart
MQ Admin/Web Developer/Consultant
WebSphere Application Server Admin |
|
Back to top |
|
 |
cots |
Posted: Tue Oct 19, 2004 8:41 am Post subject: |
|
|
Centurion
Joined: 16 Jun 2003 Posts: 105
|
Thank you for the response,
Any recommendation on which package should be good to look at. |
|
Back to top |
|
 |
jefflowrey |
Posted: Tue Oct 19, 2004 9:25 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
The contact admin Contact Admin suite is pretty cool. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
PGoodhart |
Posted: Tue Oct 19, 2004 11:20 am Post subject: |
|
|
Master
Joined: 17 Jun 2004 Posts: 278 Location: Harrisburg PA
|
MQSoftware QPasa! or contact admin or Candle/Tivioli/IBM(Big $) _________________ Patrick Goodhart
MQ Admin/Web Developer/Consultant
WebSphere Application Server Admin |
|
Back to top |
|
 |
RogerLacroix |
Posted: Tue Oct 19, 2004 1:44 pm Post subject: |
|
|
 Jedi Knight
Joined: 15 May 2001 Posts: 3264 Location: London, ON Canada
|
Hi,
Actually, this is really pretty simple to do. Here's what I did for a client a few months ago.
Code: |
connect to QMgr
Open Queue for Browse
GMO.options = MQC.MQGMO_BROWSE_FIRST + MQC.MQGMO_NO_WAIT + MQC.MQGMO_FAIL_IF_QUIESCING;
Loop while more message in queue
get message of 1-byte
if CURRENT_TIME > MQMD.PutDateTime + (5 * 60) then
Send alert
GMO.options = MQC.MQGMO_BROWSE_NEXT + MQC.MQGMO_NO_WAIT + MQC.MQGMO_FAIL_IF_QUIESCING;
EndLoop
Close Queue
Disconnect |
The reason to get only 1-byte is that we are only interested in the MQMD's PutDateTime field (rather than the message data).
The trick was to add it to cron to be scheduled every minute.
Regards,
Roger Lacroix _________________ Capitalware: Transforming tomorrow into today.
Connected to MQ!
Twitter |
|
Back to top |
|
 |
jefflowrey |
Posted: Tue Oct 19, 2004 2:41 pm Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
Roger -
In order for that to be useful at all in an enterprise, you need to stuff "If error, send alert" between every single statement . Because even if it runs every minute... and it can never connect to the queue manager because of a security change... you'll never know that it went wrong.
Then you need to decide what to do if "send alert" causes an error.
Then you need to decide where alerts go, and if that changes based on the nature of the alert. Granted, you can do this on the "other side" of "send alert". But you still need to figure it out.
Then you need to decide whether you want to manage all of these "alerts" from one place, or many.
Then you need to make all of these decisions for every single queue you want to monitor.
And then make the same decisions for everything else you need to monitor, and you also likely need to determine that an error only occurs if more than one thing goes wrong/happens at the same time.
Enterprise level system monitoring is not simple. It's not something that can reasonably be cobbled together out of scripts and quick hacks. Sure, it can and HAS been done. But there are signficantly better ways to spend your time.
Heck, anyone who has actually implemented a professional monitoring tool knows this. There's a lot of work to go into it, even if you don't write the code yourself. It all starts with actually understanding what the system in question does, and what it means when it breaks. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
RogerLacroix |
Posted: Tue Oct 19, 2004 3:08 pm Post subject: |
|
|
 Jedi Knight
Joined: 15 May 2001 Posts: 3264 Location: London, ON Canada
|
Ok Jeff, take a breath. I wasn't taking a shot at anyone.
My comments about 'really pretty simple to do' was related to the original post and not about everybody's reply to use an enterprise monitoring tool (I should have been clearer):
Quote: |
send an acknowledgement if the message stay in the queue for longer than 5 minutes |
S/He was asking about a single queue and messages remaining after a 5-minute interval. On the other hand, hundreds of queues on tens or hundreds of queue managers are a totally different situation.
I fully agree that Enterprise Monitoring tools are very complex and very robust.
You cannot totally account for every single point of failure. If you cannot rely on the infrastructure being intact (i.e. security, hard drive, network connectivity, etc..) then there are probably bigger issues than a message remaining on a queue for 5 minutes.
In my client's case, the 'Send Alert' was to do JNI call from Java to the HP-OV agent 'opcmsg'. It has worked flawlessly for 6-months. But then again, it is not doing hundreds of queues.
Anyway, that's my 2 cents.
Regards,
Roger Lacroix _________________ Capitalware: Transforming tomorrow into today.
Connected to MQ!
Twitter |
|
Back to top |
|
 |
jefflowrey |
Posted: Tue Oct 19, 2004 3:24 pm Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
RogerLacroix wrote: |
Ok Jeff, take a breath. I wasn't taking a shot at anyone.
|
Neither was I. You've got a solution that fits your client's need, that's great.
I'm just saying that the problem is more complicated than it looks, even in the simple case.
And I agree you can't account for every possible failure.
And I also agree that throwing an expensive enterprise monitoring tool at this problem, just for one queue, is hitting a small nail with a big hammer.
It's just a tricky problem that seems like it would be easy, and isn't. Even with your approach - and there are others, like using message expiry - there are always holes. And I thought that the original poster should be aware of some of the issues that might come up. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
Nigelg |
Posted: Wed Oct 20, 2004 12:01 am Post subject: |
|
|
Grand Master
Joined: 02 Aug 2004 Posts: 1046
|
Enable performance events in the qmgr
ALTER QMGR PERFMEV(ENABLED)
Enable Queue Service Interval High Events on the queue
ALTER QL(QNAME) QSVCIEV(HIGH)
Set the Queue Service Interval
ALTRE QL(QNAME) QSVCINT(300000)
The above mqsc commands will cause a msg to be written to the SYSTEM.ADMIN.PERFM.EVENT queue when a msg arrives on the queue QNAME and an MQGET is not performed on th queue within 5 minutes, just as required. To complete the loop, set the performance queue to trigger when a msg arrives, and write the triggereed app so that it reads the event queue and takes the appropriate action.
Read about Queue Service Interval events in the WMQ Event Monitoring manual at this link:
http://publibfp.boulder.ibm.com/epubs/html/csqzax04/csqzax04tfrm.htm |
|
Back to top |
|
 |
techno |
Posted: Thu Jul 14, 2005 10:09 am Post subject: |
|
|
Chevalier
Joined: 22 Jan 2003 Posts: 429
|
From the documentation, what I understand is..... the even doesn't get generated unless the MQGET is done...
Is my understanding correct?
Thanks |
|
Back to top |
|
 |
fjb_saper |
Posted: Thu Jul 14, 2005 4:01 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
If you go for a low cost monitoring solution check out the monitoring forum's stickies... but there is no guarantee that a low cost monitoring solution will do that for you...
Now if you move to MQ V6 there is a feature that gives the age of the oldest message on the queue....
Enjoy  |
|
Back to top |
|
 |
Nigelg |
Posted: Fri Jul 15, 2005 1:06 am Post subject: |
|
|
Grand Master
Joined: 02 Aug 2004 Posts: 1046
|
Use Queue Service Interval events, which do exactly what you want. Read about it in the Events manual. |
|
Back to top |
|
 |
cturner |
Posted: Wed Jul 27, 2005 8:13 am Post subject: Re: Message Timing |
|
|
Newbie
Joined: 21 Aug 2002 Posts: 9 Location: Apex, NC
|
cots wrote: |
I need to send an acknowledgement if the message stay in the queue for longer than 5 minutes. How do I do that?
|
As mentioned in previous replies, this can be done with scripts if it is for a just a couple queues. Anything more than that and it becomes a burden to maintain the scripts and keep them updated. I've been in environments where there are hundreds of these kind of scripts with even customized copies of each within a group of Sys Admins. It can easily get out of control quickly.
contact admin does provide utilities for scanning messages on queues to determine how long they have been there. In turn we could setup simple rules to send an alert if the message has been on the queue for longer than 'x' amount of time. This utility is provided with our WMQ Plugin for Contact Admin. _________________ Charles Turner
Operations & Systems Specialist
State of NC |
|
Back to top |
|
 |
malammik |
Posted: Wed Jul 27, 2005 10:33 am Post subject: |
|
|
 Partisan
Joined: 27 Jan 2005 Posts: 397 Location: Philadelphia, PA
|
|
Back to top |
|
 |
|