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 » IBM MQ API Support » Skipped message when MQGET

Post new topic  Reply to topic
 Skipped message when MQGET « View previous topic :: View next topic » 
Author Message
fredlee
PostPosted: Thu Jul 14, 2005 10:59 pm    Post subject: Skipped message when MQGET Reply with quote

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
View user's profile Send private message
Nigelg
PostPosted: Fri Jul 15, 2005 1:08 am    Post subject: Reply with quote

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
View user's profile Send private message
fredlee
PostPosted: Fri Jul 15, 2005 1:27 am    Post subject: Reply with quote

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
View user's profile Send private message
bower5932
PostPosted: Fri Jul 15, 2005 2:41 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger
tillywern
PostPosted: Fri Jul 15, 2005 10:02 am    Post subject: # of Threads? Reply with quote

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
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
wschutz
PostPosted: Fri Jul 15, 2005 10:23 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail AIM Address
bob_buxton
PostPosted: Fri Jul 15, 2005 2:31 pm    Post subject: Reply with quote

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
View user's profile Send private message
hopsala
PostPosted: Sat Jul 16, 2005 2:59 am    Post subject: Reply with quote

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
View user's profile Send private message
fredlee
PostPosted: Mon Jul 18, 2005 8:11 pm    Post subject: Reply with quote

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
View user's profile Send private message
EddieA
PostPosted: Mon Jul 18, 2005 8:53 pm    Post subject: Reply with quote

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
View user's profile Send private message
bower5932
PostPosted: Tue Jul 19, 2005 1:56 am    Post subject: Reply with quote

Jedi Knight

Joined: 27 Aug 2001
Posts: 3023
Location: Dallas, TX, USA

If you want to play with this, take a look at the mqsync samples at:

http://www.developer.ibm.com/isv/tech/sampmq.html

They allow you to put messages in and out of units of work. You can then have an MQGET running to see what is gotten.
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » IBM MQ API Support » Skipped message when MQGET
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.