Broker 10.15 | webMethods Broker Documentation | webMethods Broker Client Java API Programmer's Guide | Subscribing to and Receiving Events | Receiving Events in the Get-Events Model | Subscription Identifiers | Specifying Subscription IDs
 
Specifying Subscription IDs
The example below illustrates the use of the BrokerClient.newSubscription method to associate two subscription identifiers with two different subscriptions. This version of the BrokerClient.newSubscription method accepts these parameters:
*The subscription identifier.
*An event type name.
*An event filter string or null if event filtering is not wanted. Filters are described in Using Event Filters.
Assigning subscription identifiers
. . .
/* Make subscription #1*/
try {
c.newSubscription( 1, "Sample::SimpleEvent1",null);
} catch (BrokerException ex) {
System.out.println("Error on create subscription #1\n"+ex);
return;
}
/* Make subscription #2*/
try {
c.newSubscription( 2, "Sample::SimpleEvent2",null);
} catch (BrokerException ex) {
System.out.println("Error on create subscription #2\n"+ex);
return;
}
. . .