activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vijayaratha <>
Subject Re: Messages are repetedly sends by the queue..
Date Wed, 13 Jul 2011 18:23:30 GMT
Sorry for the wrong message..

What is actually happened is, i was polling the queue while browsing...
So i get same message again and again in the browser...

Error code;

 browser = session.createBrowser((Queue) destination);
 Enumeration enumeration = browser.getEnumeration();
  if (enumeration.hasMoreElements()) {
     	Object msg = enumeration.nextElement(); 

After iterating part added i see all messages processed via the browser,
  if (enumeration.hasMoreElements()) {
     	Object msg = enumeration.nextElement(); 

/** this while block solved the issue***/
                   while (enumeration.hasMoreElements()) {
                	Object msg2 = enumeration.nextElement();                
<-------this msg2 object is not used by the later part of coding..extra

I don't know how that while block solved the issue, which occurred with
polling the queue...
Any idea on this?

Or better solution for this?


View this message in context:
Sent from the ActiveMQ - User mailing list archive at

View raw message