Author |
Message
|
fredlee |
Posted: Thu Jul 14, 2005 10:59 pm Post subject: Skipped message when MQGET |
|
|
 Newbie
Joined: 02 Aug 2004 Posts: 6 Location: Hong Kong
|
Hi All,
my program is reading the message queue by MQGMO-BROWSE-NEXT
but we found when in high volume, it skip some records. Is anyone have idea on this? We are opening the queue, looping the queue and wait for the result by MQGET
Open queue option are:
MQOO-INPUT-AS-Q-DEF
MQOO-FAIL-IF-QUIESCING
MQOO-BROWSE
Get option are:
MQGMO-WAIT
MQGMO-CONVERT
MQGMO-BROWSE-NEXT
Thanks, Fred |
|
Back to top |
|
 |
Nigelg |
Posted: Fri Jul 15, 2005 1:08 am Post subject: |
|
|
Grand Master
Joined: 02 Aug 2004 Posts: 1046
|
The browse cursor, the logical position in the queue, has passed a msg which is in an uncommitted UoW. The browse will not go back to that msg until a new BROWSE_FIRST is done, and it starts reading from the start of the queue again. |
|
Back to top |
|
 |
fredlee |
Posted: Fri Jul 15, 2005 1:27 am Post subject: |
|
|
 Newbie
Joined: 02 Aug 2004 Posts: 6 Location: Hong Kong
|
Thank for your advice.
More question:
1. what is UoW?
2. How can I prove that msg is in uncommitted Uow?
Nigelg wrote: |
The browse cursor, the logical position in the queue, has passed a msg which is in an uncommitted UoW. The browse will not go back to that msg until a new BROWSE_FIRST is done, and it starts reading from the start of the queue again. |
|
|
Back to top |
|
 |
bower5932 |
Posted: Fri Jul 15, 2005 2:41 am Post subject: |
|
|
 Jedi Knight
Joined: 27 Aug 2001 Posts: 3023 Location: Dallas, TX, USA
|
UOW - unit of work
One way to see messages in a UOW is to see a current depth that is larger than the number of messages you can get. Uncommitted messages count in the current depth. |
|
Back to top |
|
 |
tillywern |
Posted: Fri Jul 15, 2005 10:02 am Post subject: # of Threads? |
|
|
 Centurion
Joined: 28 Jan 2003 Posts: 109 Location: Colorado
|
Have you also considered threading?
If the process reading messages off the queue is competing with another process then MQSeries allocates which thread will get the next message.
This may be trivial but it is a thought. |
|
Back to top |
|
 |
wschutz |
Posted: Fri Jul 15, 2005 10:23 am Post subject: |
|
|
 Jedi Knight
Joined: 02 Jun 2005 Posts: 3316 Location: IBM (retired)
|
Fredlee--
How do you know that messages are being skipped by the browse cursor?
Is only one program doing browse and destructive gets?
Are programs putting messages onto the queue using priority?
I think we need to know more about exactly what you are doing here....  _________________ -wayne |
|
Back to top |
|
 |
bob_buxton |
Posted: Fri Jul 15, 2005 2:31 pm Post subject: |
|
|
 Master
Joined: 23 Aug 2001 Posts: 266 Location: England
|
There are a number of circumstances that can cause a browse to miss messages:
- Put of a message with higher priority
- Uncommitted put
- Rollback of MQGET
- Browse with lock
- Failed get (e.g. Truncated message)
_________________ Bob Buxton
Ex-Websphere MQ Development |
|
Back to top |
|
 |
hopsala |
Posted: Sat Jul 16, 2005 2:59 am Post subject: |
|
|
 Guardian
Joined: 24 Sep 2004 Posts: 960
|
tillywern said:
Quote: |
If the process reading messages off the queue is competing with another process then MQSeries allocates which thread will get the next message. |
This is not true for BROWSE option.
When using normal (destructive) MQGET then indeed MQ allocates only one of the threads (or processes) that reads the message, so you will never have two threads reading the same msg simultaneously. However, BROWSE works differently, and if two threads are reading the same queue there is definitely a possibility they will at one point read the same msg at the same time. To avoid possible probs, one uses the LOCK option.
(btw, to those who know such mechanisms, I will note that destructive MQGET works with Semaphores (or ECB, or another depending on OS) and actually "wakes" threads, meaning it is not the thread that polls the queue, but mq that polls the queue and wakes the process only if a msg arrived or there was a timeout. BROWSE, as stated earlier, works differently) |
|
Back to top |
|
 |
fredlee |
Posted: Mon Jul 18, 2005 8:11 pm Post subject: |
|
|
 Newbie
Joined: 02 Aug 2004 Posts: 6 Location: Hong Kong
|
Thanks for you advise.
I would like to know more about the syncpoint (MQPMO-SYNCPOINT)
In the MQ client side, they may have multiple user put the message to the MQ server.
Is it mean that if MQClient-1 put a message (with MQPMO-SYNCPOINT) and not commited, in the same time MQClient-2 put a message and commited, MQGET will skip reading the MQClient-1 message, and read MQClient-2?
If Syncpoint need to used , is it need both MQ Client & server side using MQPMO-SYNCPOINT and MQGMO-SYNCPOINT? |
|
Back to top |
|
 |
EddieA |
Posted: Mon Jul 18, 2005 8:53 pm Post subject: |
|
|
 Jedi
Joined: 28 Jun 2001 Posts: 2453 Location: Los Angeles
|
Quote: |
Is it mean that if MQClient-1 put a message (with MQPMO-SYNCPOINT) and not commited, in the same time MQClient-2 put a message and commited, MQGET will skip reading the MQClient-1 message, and read MQClient-2? |
Until a message is Commited, it is not available for GETting, so yes.
Cheers, _________________ Eddie Atherton
IBM Certified Solution Developer - WebSphere Message Broker V6.1
IBM Certified Solution Developer - WebSphere Message Broker V7.0 |
|
Back to top |
|
 |
bower5932 |
Posted: Tue Jul 19, 2005 1:56 am Post subject: |
|
|
 Jedi Knight
Joined: 27 Aug 2001 Posts: 3023 Location: Dallas, TX, USA
|
|
Back to top |
|
 |
|