Broker 10.15 | webMethods Broker Documentation | webMethods Broker Client C 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 following example illustrates the use of the awNewSubscriptionWithId function to associate two subscription identifiers with two different subscriptions. The awNewSubscriptionWithId function accepts these parameters:
*A BrokerClient handle.
*The subscription identifier.
*An event type name.
*An event filter or NULL if event filtering is not desired. Filters are described in Managing Event Types.
BrokerClient c;
. . .
/* Make a subscription #1*/
err = awNewSubscriptionWithId(c, 1, "Sample::SimpleEvent1", NULL);
if (err != AW_NO_ERROR) {
printf("Error on create subscription\n%s\n", awErrorToString(err));
return 0;
}
/* Make a subscription #2*/
err = awNewSubscriptionWithId(c, 2, "Sample::SimpleEvent2", NULL);
if (err != AW_NO_ERROR) {
printf("Error on create subscription\n%s\n", awErrorToString(err));
return 0;
}
. . .