Broker 10.5 | webMethods Broker Documentation | webMethods Broker Client Java API Programmer's Guide | Subscribing to and Receiving Events | Event Subscriptions | Subscribing to Events
 
Subscribing to Events
 
Uniqueness of Subscriptions
Your application can subscribe to an event by calling one of the BrokerClient.newOrReconnect methods. The example below contains an excerpt from a sample application that shows the use of the BrokerClient.newSubscription method. This method accepts these parameters:
*An event type name.
*An event filter string or null if event filtering is not wanted. Filters are described in Using Event Filters.
BrokerClient c;
. . .
/* Make a subscription */
try {
c.newSubscription("Sample::SimpleEvent",null);
} catch (BrokerException ex) {
System.out.println("Error on create subscription\n"+ex);
return;
}
. . .