ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » General Discussion » time a msg is in a queue

Post new topic  Reply to topic
 time a msg is in a queue « View previous topic :: View next topic » 
Author Message
MQGuy2000
PostPosted: Mon Jul 21, 2003 10:28 am    Post subject: time a msg is in a queue Reply with quote

Centurion

Joined: 20 Jul 2003
Posts: 131

is teher anyway we can say how much time a message is on a queue. I mean teh time at which the message is put on a queue and teh time it is taken by the application??

Did any come across this scenario?

Please help.

MQGuy2000
Back to top
View user's profile Send private message
bduncan
PostPosted: Mon Jul 21, 2003 12:18 pm    Post subject: Reply with quote

Padawan

Joined: 11 Apr 2001
Posts: 1554
Location: Silicon Valley

Well, with a product like MQSeries, you need to consider the clock differences between machines hosting the queue managers. Assuming you have some central clock server that all the machines are sync'ed to, you can be depend on machine A's clock being the same as machine B's. Let's say an application connects to A's queue manager and puts the message to a queue in B's queue manager. When the message is handed off to A's queue manager, the PUTTIME attribute in the MQMD gets set. The message may linger on A for a while (the channel to B may be down, or there may be other messages on the transmission queue, etc.) but it will eventually make it to the queue on B. Now another application retrieves the message. When the MQGET call returns, it should immediately get the current time. It can now compare this to the PUTTIME attribute in the message, the delta being the time it took the message to get from the putting application to the getting application.
Another way to do it is to have the putting application get the current time right before it puts the message and then append this value to the message contents (or even the correlid if your application is controlling that). This method is useful when you want the time to already be in a certain format on the receiving end (like milliseconds since 1970, etc...)
_________________
Brandon Duncan
IBM Certified MQSeries Specialist
MQSeries.net forum moderator
Back to top
View user's profile Send private message Visit poster's website AIM Address
PeterPotkay
PostPosted: Wed Jul 30, 2003 4:53 pm    Post subject: Reply with quote

Poobah

Joined: 15 May 2001
Posts: 7722

If you are putting and getting from the same queue, the easiest way is to do the put with a known Expiry value. When you do the get, the Expiry will have been decremented by however long the message was on the queue, in tenths of a second. Subtract the Expiry after the get from the known value that was used on the put and you will have the number you are looking for, down to the 1/10 of a second.
_________________
Peter Potkay
Keep Calm and MQ On
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » General Discussion » time a msg is in a queue
Jump to:  



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.