Author |
Message
|
alm_doors |
Posted: Thu May 28, 2009 12:05 am Post subject: MQ Message how to get the timestamp |
|
|
Newbie
Joined: 24 May 2009 Posts: 4
|
Hi everybody,
I need to read the timestamp of my MQMessage , does anybody knows any method how to get it ?
Thx in advance, |
|
Back to top |
|
 |
Vitor |
Posted: Thu May 28, 2009 12:19 am Post subject: Re: MQ Message how to get the timestamp |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
alm_doors wrote: |
I need to read the timestamp of my MQMessage , does anybody knows any method how to get it ? |
Interogate the timestamp property?
I'm assuming I'm misunderstanding the question here. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
alm_doors |
Posted: Thu May 28, 2009 12:24 am Post subject: Re: MQ Message how to get the timestamp |
|
|
Newbie
Joined: 24 May 2009 Posts: 4
|
Vitor wrote: |
alm_doors wrote: |
I need to read the timestamp of my MQMessage , does anybody knows any method how to get it ? |
Interogate the timestamp property?
I'm assuming I'm misunderstanding the question here. |
I need to know the exact time the message was put on the queue.. which I thougt I could get it through timestamp... Is that possible and how?? |
|
Back to top |
|
 |
Vitor |
Posted: Thu May 28, 2009 12:29 am Post subject: Re: MQ Message how to get the timestamp |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
alm_doors wrote: |
I need to know the exact time the message was put on the queue.. which I thougt I could get it through timestamp... Is that possible and how?? |
It is possible and I again recommend the timestamp property (which contains the time the message was put) to you. Your question just seemed a little obvious earlier.
Naturally the accuracy of the time is dependant on the system clock. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
alm_doors |
Posted: Thu May 28, 2009 12:36 am Post subject: Re: MQ Message how to get the timestamp |
|
|
Newbie
Joined: 24 May 2009 Posts: 4
|
Vitor wrote: |
alm_doors wrote: |
I need to know the exact time the message was put on the queue.. which I thougt I could get it through timestamp... Is that possible and how?? |
It is possible and I again recommend the timestamp property (which contains the time the message was put) to you. Your question just seemed a little obvious earlier.
Naturally the accuracy of the time is dependant on the system clock. |
Sorry I am the absolutely beginner I have MQMessage mess =
how can I get this property ?? |
|
Back to top |
|
 |
Vitor |
Posted: Thu May 28, 2009 12:40 am Post subject: Re: MQ Message how to get the timestamp |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
alm_doors wrote: |
Sorry I am the absolutely beginner I have MQMessage mess =
how can I get this property ?? |
Firstly - get some training. Push back on your management, this is not the easiest stuff to teach yourself (though experimentation is a valid method of expanding on your knowledge). Note that this forum is not a training resource.
Secondly - refer to the relevent documentation. I'm assuming you're using Java and the manual helpfully titled "Using Java" will tell you everything you need to know on this.
(Obviously if I'm wrong and you're using .NET, the manually helpfully titled "Using .NET" will be more use to you......)
You'll find a link convieniently provided at the top of this page.
Happy Reading!  _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
alm_doors |
Posted: Thu May 28, 2009 1:01 am Post subject: Re: MQ Message how to get the timestamp |
|
|
Newbie
Joined: 24 May 2009 Posts: 4
|
thx for the tip
Syntax: To get: datetime = MQMessage.PutDateTime
To set: MQMessage.PutDateTime = datetime |
|
Back to top |
|
 |
PeterPotkay |
Posted: Thu May 28, 2009 3:48 am Post subject: |
|
|
 Poobah
Joined: 15 May 2001 Posts: 7722
|
Since an application can set the Put Date and Time itself, if its authorized to do so and if it uses the correct options, you can't trust this value 100% to accurately tell you when the message hit the queue.
And if the app did allow the Queue Manager to set the message's time but it was originally put on a remote q manager, the time will be from that put, not when it finally landed on your queue.
If you are getting the oldest message on the queue, you can use the Oldest Message Age property of the queue to determine when the message landed there.
Otherwise you will need an API Exit to log the MQPUT times. If you want to be 100% sure when a message landed on a queue. _________________ Peter Potkay
Keep Calm and MQ On |
|
Back to top |
|
 |
Vitor |
Posted: Thu May 28, 2009 3:53 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
PeterPotkay wrote: |
And if the app did allow the Queue Manager to set the message's time but it was originally put on a remote q manager, the time will be from that put, not when it finally landed on your queue. |
Good point.
PeterPotkay wrote: |
Otherwise you will need an API Exit to log the MQPUT times. If you want to be 100% sure when a message landed on a queue. |
With the standard disclaimers about exits. Especially for a self-proclaimed "absolute beginner". _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
fjb_saper |
Posted: Thu May 28, 2009 7:43 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
And don't forget as long as we are discussing times that there also is a difference between put time and commit time.
Typically commit time is the time when the outgoing message becomes available. So if you are using a UOW the put time and commit time may differ.  _________________ MQ & Broker admin |
|
Back to top |
|
 |
|