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 » findind Depth and reading the messages in a Loop

Post new topic  Reply to topic
 findind Depth and reading the messages in a Loop « View previous topic :: View next topic » 
Author Message
dvishu78
PostPosted: Sun Sep 23, 2007 9:47 pm    Post subject: findind Depth and reading the messages in a Loop Reply with quote

Novice

Joined: 15 Jun 2006
Posts: 20
Location: INDIA

Hi All,

I have a requirement of reading the messages from a Queue by finding the depth and reading all the messages one by one using loop until the depth becomes zero( i mean only with intial depth ). This is we like we run in Batch job .

Iam able to fine the depth and read theQueue but it is reading first message and for the next message its throwing An MQException occurred in MQget method with completion code 2 and reason code 2033.

please could any one suggest me in using any particular options or any other way to follow

thanks
Back to top
View user's profile Send private message Send e-mail
Mr Butcher
PostPosted: Sun Sep 23, 2007 10:42 pm    Post subject: Reply with quote

Padawan

Joined: 23 May 2005
Posts: 1716

is your second read with a clean message descriptor? if you reuse the storage, the message descriptor that was filled from the first get is used as input for the second get (yes, there are input fields in the message descriptor). if you do not clean msgid and correlid mq will try to get a message with matching ids, which may not be there...
_________________
Regards, Butcher
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Sun Sep 23, 2007 10:55 pm    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

This is the wrong way to build a loop for MQ. Because there's all kinds of ways that queue depth could be different than the number of messages that are available for you to GET.

You should be writing your loop to stop once you get a 2033.

As Herr Butcher says, you also need to make sure you are cleaning or creating a new or otherwise setting the MQMD for each GET so that you don't match things you don't want to match.
_________________
I am *not* the model of the modern major general.
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 » IBM MQ API Support » findind Depth and reading the messages in a Loop
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.