activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bobsponge <ruben.gar...@tecnicasdeingenieria.com>
Subject Problem with enumeration in queue browsing
Date Mon, 28 Apr 2008 14:46:43 GMT

Hello. 
I'm using a browser for getting messages stored in a queue without removing
them. The queue is filled with more than 12000 elements and I want to access
to single messages one by one. The main part of the method I use for getting
messages looks like this one:

if((queueContent= browser.getEnumeration())!=null){           
targetSize=0; 
            while(queueContent.hasMoreElements() && !msgFound) {
               if((qDequeuedMsg = (Message)
queueContent.nextElement())!=null){

                  if(targetSize==pIndex){
                     objectMsg = ( ObjectMessage ) qDequeuedMsg;
                     qMsg= (QueueMessage) objectMsg.getObject();
                     msgFound=true;
                  }

                  targetSize++;
               }
}

>From a different part of my application I call this method for getting
messages from the queue as long as they're needed. 
The first 156 times it works ok, but the next time this method is called and
the enumeration is built no more than 67 messages are listed. Every time I
run my application it always happens the same problem.
I'm ussing ActiveMQ 4.1.1. 
Is there any problem in listing messages this way?

Thank you


-- 
View this message in context: http://www.nabble.com/Problem-with-enumeration-in-queue-browsing-tp16940552s2354p16940552.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Mime
View raw message