Author |
Message
|
PeterPotkay |
Posted: Mon Jan 14, 2008 8:51 am Post subject: |
|
|
 Poobah
Joined: 15 May 2001 Posts: 7722
|
got me thinking out loud....
If one commits 100 messages, are all 100 instantly and concurrently available? Or are they serially made available one after another, maybe so fast it seems like its all at once
(I realize this is "If a tree falls in the forest..." type of question) _________________ Peter Potkay
Keep Calm and MQ On |
|
Back to top |
|
 |
MartynB |
Posted: Mon Jan 14, 2008 8:59 am Post subject: Re: Use of MQCMIT? Expert required... |
|
|
Novice
Joined: 14 Jan 2008 Posts: 24
|
PeterPotkay wrote: |
MartynB wrote: |
The only way I can think of achieving this is to use the PutDate and PutTime of the LAST request for ALL the messages I put to the queue then immediately call MQCMIT however this won't be 100% accurate. Does anyone have any ideas how I might acheive this?
|
If your logic is:
1. MQCONN
2. MQOPEN
3. MQPUT
. MQPUT
. MQPUT
102. MQPUT
103. MQCMIT
104. MQPUT
. MQPUT
. MQPUT
202. MQPUT
203. MQCMIT
204. MQCLOSE
205. MQDISC
If you don't do anything between the last MQPUT of the batch and the MQCMIT, I would be surpised if you lost more than a few milliseconds, assuming the network connection is good between the MQClient machine and the MQ server. Notice I used batches of 100, for reasons Jeff outlined.
|
Yeah, that's effectively what I'm planning on doing. Using the PutDate/PutTime from step 102/step 202 and the PutDate/PutTime from each individual response to calculate times.
PeterPotkay wrote: |
If you want, you could grab the timestamp from the O/S of your MQ Client machine before and after the MQCMIT, see how long that took, and then add that to the last MQPUT's time. But now you're really splitting hairs. If you'll never be 100% accurate, does it make a diff if you are 99.99 or 99.999% accurate?  |
You're right - that is splitting hairs, I don't think I need go this far if there isn't a better way of doing it!  |
|
Back to top |
|
 |
MartynB |
Posted: Mon Jan 14, 2008 9:01 am Post subject: |
|
|
Novice
Joined: 14 Jan 2008 Posts: 24
|
PeterPotkay wrote: |
got me thinking out loud....
If one commits 100 messages, are all 100 instantly and concurrently available? Or are they serially made available one after another, maybe so fast it seems like its all at once
(I realize this is "If a tree falls in the forest..." type of question) |
AFAIK they will all be available at once however I may stand corrected. |
|
Back to top |
|
 |
jefflowrey |
Posted: Mon Jan 14, 2008 9:21 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
I'm sure there's a very small window in which the "commited" flag on some messages in a transaction is set, but not yet all of them have been set.
I'm also sure that this flag is set in proper order - so the first message that would be available for GET is the first one that has this flag set, and down the line. Just in in case some app happens to be able to start a valid GET within the very small time frame.
I'd make a small wager as well that all gets are stalled briefly while there's a file system lock on the q and/or log files, thus closing this window entirely. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
MartynB |
Posted: Mon Jan 14, 2008 10:25 am Post subject: |
|
|
Novice
Joined: 14 Jan 2008 Posts: 24
|
jefflowrey wrote: |
I'm sure there's a very small window in which the "commited" flag on some messages in a transaction is set, but not yet all of them have been set.
I'm also sure that this flag is set in proper order - so the first message that would be available for GET is the first one that has this flag set, and down the line. Just in in case some app happens to be able to start a valid GET within the very small time frame.
I'd make a small wager as well that all gets are stalled briefly while there's a file system lock on the q and/or log files, thus closing this window entirely. |
Me think the man doth know too much!  |
|
Back to top |
|
 |
Vitor |
Posted: Mon Jan 14, 2008 11:17 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
MartynB wrote: |
jefflowrey wrote: |
I'm sure there's a very small window in which the "commited" flag on some messages in a transaction is set, but not yet all of them have been set.
I'm also sure that this flag is set in proper order - so the first message that would be available for GET is the first one that has this flag set, and down the line. Just in in case some app happens to be able to start a valid GET within the very small time frame.
I'd make a small wager as well that all gets are stalled briefly while there's a file system lock on the q and/or log files, thus closing this window entirely. |
Me think the man doth know too much!  |
The Grand Poobah rules MQSeries.net  _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
jefflowrey |
Posted: Mon Jan 14, 2008 11:34 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
MartynB wrote: |
Me think the man doth know too much!  |
To be clear, I've never seen any MQ source code.
I'm just guessing based on a) what I know, and b) how I'd do it, if I were feeling very very smart (which is rare...) _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
|