Broker 10.5 | webMethods Broker Documentation | webMethods Broker Client Java API Programmer's Guide | Using the Callback Model | Dispatching Callback Methods | Using mainLoop
Using mainLoop
The BrokerClient.mainLoop method is similar to BrokerClient.dispatch, except that it enters an event loop that will continue to receive and dispatch events until BrokerClient.stopMainLoop is called. The example below contains an excerpt from a sample application that shows how to use the BrokerClient.mainLoop method.
/* Do main loop */
try {
} catch (BrokerException ex) {
System.out.println("Error on dispatch\n" + ex);