Broker 10.5 | webMethods Broker Documentation | webMethods Broker Administration Java API Programmer’s Guide | Using Queue Browsers | Creating and Closing Client Queue Browsers | For a Client Queue Browser
 
For a Client Queue Browser
*Create a queue browser using the BrokerClient.createClientQueueBrowser() method. This method creates a queue browser on the client's queue.
Note:
This mode of operation does not require a client queue to be locked; therefore the client queue content can undergo changes while the queue browser is open.
*Close the queue browser using the BrokerClientQueueBrowser.closeClientQueueBrowser() method.
The following example illustrates how to create a client queue browser on client's own queue:
BrokerClient client = null;
BrokerClientQueueBrowser browser = null;
 
//Create a Broker client
try {
client = new BrokerClient(broker_host,
broker_name,
client_id,
client_group,
"QueueBrowser - SELF",
null);
} catch(BrokerException ex) {
System.out.println("Failed to create client.");
return;
}
. . .
//Create a queue browser
try {
browser = client.createClientQueueBrowser();
} catch(BrokerException ex) {
System.out.println("Failed to create client queue browser.");
return;
}
. . .
//Various queue browser operations
. . .
//Close the queue browser
try {
browser.closeQueueBrowser();
} catch(BrokerException ex) {
System.out.println("Failed to close client queue browser.");
return;
}