[jboss-user] [JBoss Messaging] - browsing the queue message in chunks/page wise

rajsjha do-not-reply at jboss.com
Wed Jul 22 00:50:00 EDT 2009


My queue is deployed using jboss messaging with PageSize configured as 1000. I am using the following code to browse the messages on queue

QueueBrowser browser = session.createBrowser(queue);
        connection.start();
        Enumeration msgs = browser.getEnumeration();
        int count = 0;
        if ( !msgs.hasMoreElements() ) { 
               System.out.println("No messages in queue");
           } else { 
               while (msgs.hasMoreElements()) { 
                 count++;
                 TextMessage tempMsg = (TextMessage)msgs.nextElement(); 
                   System.out.println("Message: " + tempMsg.getText()); 
           }

View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4245167#4245167

Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4245167



More information about the jboss-user mailing list