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 Java / JMS » getCurrentDepth() ?

Post new topic  Reply to topic
 getCurrentDepth() ? « View previous topic :: View next topic » 
Author Message
platondaniel
PostPosted: Mon Aug 26, 2002 3:18 am    Post subject: getCurrentDepth() ? Reply with quote

Novice

Joined: 04 Aug 2002
Posts: 12

Hello !

I am trying to get all the messages in the queue at once. For that i use getCurrentDepth to determine if there are any messages in the queue.
Here's the code:

Code:
int depth = q.getCurrentDepth();
while ( depth > 0)
{
           q.get(message, gmo);
           msgText = message.readUTF();
           System.out.println("Msg: " + msgText);
           depth--;
}


And here's the output

Msg: Platon#Daniel
Unable to load message catalog - mqji
Exceptie aruncata de MQ. Completion code 2. Reason code 2033. Have a nice day !
com.ibm.mq.MQException: Completion Code 2, Reason 2033
at com/ibm/mq/MQQueue.get (MQQueue.java:493)
at GetMSGS.<init> (GetMSGS.java:35)
at GetMSGS.main (GetMSGS.java:57)

Same thing happens when I put
Code:
while (q.getQueueDepth() > 0)
{
    ...
}


What is the problem ? The getCurrentDepth() prints fine.

Thanks,
DAN
Back to top
View user's profile Send private message Yahoo Messenger
Coz
PostPosted: Sun Sep 08, 2002 10:21 pm    Post subject: Reply with quote

Apprentice

Joined: 20 Feb 2002
Posts: 44
Location: Basel CH

Quite simple.
The Queue is empty (2033) and you aren't handling the exception.
Wrap it in a try catch. If the reason code is 2033 dont let the program bomb out.
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 Java / JMS » getCurrentDepth() ?
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.