Author |
Message
|
linorosa |
Posted: Tue Mar 17, 2009 8:48 am Post subject: How to see the time a message was put in local queue? |
|
|
Novice
Joined: 03 Mar 2009 Posts: 10
|
Is there a way to know the exact timestamp a message was put in my local queue? |
|
Back to top |
|
 |
zpat |
Posted: Tue Mar 17, 2009 8:54 am Post subject: |
|
|
 Jedi Council
Joined: 19 May 2001 Posts: 5866 Location: UK
|
The MQMD putdate and puttime is the time of the original MQPUT.
If it has arrived from another queue manager, you cannot tell from the message when it was placed in your local queue by the channel. |
|
Back to top |
|
 |
linorosa |
Posted: Tue Mar 17, 2009 8:58 am Post subject: |
|
|
Novice
Joined: 03 Mar 2009 Posts: 10
|
That was what I feared...
The message comes from a remote queue manager. I wanted to know the exact time the message was put in my local queue to generate performance information.
To me it is important to know how much time the message waited in the queue before being consumed by the application. |
|
Back to top |
|
 |
mqjeff |
Posted: Tue Mar 17, 2009 9:02 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
In MQ v7 (and maybe mq v6, I've forgotten), you can track the oldest message time and oldest message date on queue statistics. |
|
Back to top |
|
 |
PeterPotkay |
Posted: Tue Mar 17, 2009 3:46 pm Post subject: |
|
|
 Poobah
Joined: 15 May 2001 Posts: 7722
|
mqjeff wrote: |
In MQ v7 (and maybe mq v6, I've forgotten), you can track the oldest message time and oldest message date on queue statistics. |
This capability exists in MQ 6. _________________ Peter Potkay
Keep Calm and MQ On |
|
Back to top |
|
 |
steiger |
Posted: Wed Mar 18, 2009 2:37 am Post subject: |
|
|
Newbie
Joined: 18 Mar 2009 Posts: 9 Location: Germany
|
Maybe you could use events. You could then interpret the events in the appropriate event queue, which should contain the time the were fired. |
|
Back to top |
|
 |
linorosa |
Posted: Wed Mar 18, 2009 3:04 am Post subject: |
|
|
Novice
Joined: 03 Mar 2009 Posts: 10
|
I thought about using events, but I don't know much about them since I'm new to MQ.
Which event is triggered each time a message is put in local queue? |
|
Back to top |
|
 |
Mr Butcher |
Posted: Wed Mar 18, 2009 3:23 am Post subject: |
|
|
 Padawan
Joined: 23 May 2005 Posts: 1716
|
afaik there is no event when a message is put to a queue.
Maybe COA / COD is an option, time difference between COA and COD is the time spend on the queue.
A channel exit that logs incoming messages may be another option.
Or create your own logging-only application, that picks messages from the inbound queue, logs them, and puts them to the application inbound queue. _________________ Regards, Butcher |
|
Back to top |
|
 |
linorosa |
Posted: Wed Mar 18, 2009 3:36 am Post subject: |
|
|
Novice
Joined: 03 Mar 2009 Posts: 10
|
COA/COD was actualy the first idea.
The problem is that MQ automatically sends them to the remote client, so we never see them...
Woudn't an exit hit the performance? |
|
Back to top |
|
 |
mqjeff |
Posted: Wed Mar 18, 2009 3:42 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
If you know a) when you processed a given message, b) how old the oldest message on the queue at that time is, then you probably know everything you need to know about when the oldest message on the queue was delivered.
You're clearly trying to set up some kind of non-repudiation in terms of "you sent your message at time X, we received it at time Y and processed it at time Z", with the intent being to show that Z-Y approaches "zero".
Almost everyone ignores time Y, and optimizes their receiving applications such that queues generally sit empty with an application sitting in a GET.
Then Z-Y is as close to zero as makes any difference at all. |
|
Back to top |
|
 |
fjb_saper |
Posted: Wed Mar 18, 2009 2:42 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
mqjeff wrote: |
If you know a) when you processed a given message, b) how old the oldest message on the queue at that time is, then you probably know everything you need to know about when the oldest message on the queue was delivered.
You're clearly trying to set up some kind of non-repudiation in terms of "you sent your message at time X, we received it at time Y and processed it at time Z", with the intent being to show that Z-Y approaches "zero".
Almost everyone ignores time Y, and optimizes their receiving applications such that queues generally sit empty with an application sitting in a GET.
Then Z-Y is as close to zero as makes any difference at all. |
This is nice when everything is working as expected. Throw in a wrench like a channel in retry for an hour and it does not matter whether z-y is near zero ( about 4 ms) you still missed the SLA for z-x ... But monitoring should be able to alert you to this kind of situation. Have fun  _________________ MQ & Broker admin |
|
Back to top |
|
 |
Vitor |
Posted: Wed Mar 18, 2009 3:01 pm Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
linorosa wrote: |
Woudn't an exit hit the performance? |
That depends on the performance of your exit.
Please see the many various posts on exits in here. A badly written exit will certainly impact performance; a very badly written exit will bring your queue manager down in flames!
If you're new to WMQ, I'd avoid exits. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
Sam Uppu |
Posted: Wed Mar 18, 2009 3:56 pm Post subject: Re: How to see the time a message was put in local queue? |
|
|
 Yatiri
Joined: 11 Nov 2008 Posts: 610
|
linorosa wrote: |
Is there a way to know the exact timestamp a message was put in my local queue? |
I think MQ can't provide the timestamps for each and every message.
with amqsmon we can know the maxdepth of a queue and max message age of messages for a period of time & PutCount and GetCount...and also with qstatus.
Thanks. |
|
Back to top |
|
 |
linorosa |
Posted: Mon Apr 13, 2009 4:26 am Post subject: |
|
|
Novice
Joined: 03 Mar 2009 Posts: 10
|
I'm bumping this topic because I was doing some more research and got a little intrigued.
As you told me, I can ask a queue what is the age of its oldest message. Then, when the application consumes this message, MQ shows me the age of the next oldest message.
So MQ does store the age of every message somewhere, but makes it impossible for me to retrieve this information? Or is this age attribute relative to the time the message was put on the remote queue (i.e. the same information I could get with putDateTime) ? |
|
Back to top |
|
 |
Mr Butcher |
Posted: Mon Apr 13, 2009 10:11 pm Post subject: |
|
|
 Padawan
Joined: 23 May 2005 Posts: 1716
|
that age attribute is local only. _________________ Regards, Butcher |
|
Back to top |
|
 |
|