activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vijayaratha <rat...@wso2.com>
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(); 
//code         
       }


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
object..??
                }
             //code         
       }

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?

Thanks
-ratha..


--
View this message in context: http://activemq.2283324.n4.nabble.com/Messages-are-repetedly-sends-by-the-queue-tp3664255p3665725.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Mime
View raw message