Summary: Using the
QueueBrowser to examine messages in a queue without deleting them.
Browsing JMS QueuesA client application can create a QueueBrowser to examine messages in a queue without actually deleting them. The QueueBrowser contains the getEnumeration() method, which returns an enumeration of the queue's messages: QueueBrowser browser = session.createBrowser(queue); Enumeration enum = browser.getEnumeration(); while (enum.hasMoreElements()) { System.out.println("Message on queue is: " + iter.nextElement()); }
The JMS specifications do not define whether the QueueBrowser represents a snapshot of the queue, or whether the QueueBrowser dynamically updates it. However, with the Enterprise Messaging Grid, a snapshot is taken when the call is made to getEnumeration(). |
![]() |
GigaSpaces.com - Legal Notice - 3rd Party Licenses - Site Map - API Docs - Forum - Downloads - Blog - White Papers - Contact Tech Writing - Gen. by Atlassian Confluence |