Subscribing to Events
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;
}
. . .