MQQueueBrowser

public class MQQueueBrowser
extends Object
implements QueueBrowser
java.lang.Object
   |
   +----com.ibm.mq.jms.MQQueueBrowser
          

A client uses an MQQueueBrowser to look at messages on a queue without removing them.

Note that the WebSphere MQ class MQQueueEnumeration is used to hold the browse cursor.

Methods

close

public void close() throws JMSException;

Closes all open queues left in enumerated objects. Because a provider can allocate some resources outside the JVM on behalf of an MQQueueBrowser, clients must close them when they are not needed. You cannot rely on garbage collection to reclaim these resources eventually, because this might not occur soon enough.

Exceptions

getEnumeration

public Enumeration getEnumeration() throws JMSException;

Gets an enumeration for browsing the current queue messages in the order that they are received.

Note that if the browser is created for a nonexistent queue, this is not detected until the first call to getEnumeration().

Returns
Exceptions

getMessageSelector

public String getMessageSelector() throws JMSException;

Gets the queue browser's message selector expression.

Returns
Exceptions

getQueue

public Queue getQueue() throws JMSException;

Gets the queue associated with this queue browser.

Returns
Exceptions