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 » Reading all the messages in MQ

Post new topic  Reply to topic
 Reading all the messages in MQ « View previous topic :: View next topic » 
Author Message
arun.buddha
PostPosted: Thu May 22, 2008 3:24 am    Post subject: Reading all the messages in MQ Reply with quote

Newbie

Joined: 22 May 2008
Posts: 1

Hi all , I am a new bie to MQ. I am having a piece of code

while( myQueue->currentDepth() )
{
myQueue->get( imsg , gmo );
cout << "Recv : " << buf ;
}

to read the messages in MQ sequentially. But, my get() method gets
blocked while processing next request. ( Queue has lot of messages and
initial read is successful. )

My options set at get is,

gmo.setOptions(MQGMO_WAIT | MQGMO_ACCEPT_TRUNCATED_MSG );
gmo.setWaitInterval( MQWI_UNLIMITED );


Anybody can help me to know about this?
Back to top
View user's profile Send private message
Vitor
PostPosted: Thu May 22, 2008 3:50 am    Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

Ok:

- use the search facility. All your points have been asked and answered before.
- read the documentation. The Application Programmer Guide covers all these points, if not explicitly then in general.
- Get yourself on a training course. A programming one might be good looking at your code.
- your get call is blocking because you don't reset the object id it's looking for. The documentation will explain why you need to do this.
- do not use currentDepth to find how many messages there are. It doesn't do what you think it does, and your loop will not run the right number of times.
- include the fail if quescing option if you're using unlimited wait, or you'll prevent the queue manager closing cleanly.

Aside from that it was fine.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
bower5932
PostPosted: Thu May 22, 2008 4:02 am    Post subject: Reply with quote

Jedi Knight

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

I'll also add that you might want to go look at some of the samples.....
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 » General Discussion » Reading all the messages in MQ
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.