Broker 10.15 | webMethods Broker Documentation | webMethods Broker Client C API Programmer's Guide | Using Event Filters | Using Filters with Subscriptions
 
Using Filters with Subscriptions
When you subscribe to a particular event type using the awNewSubscription function, you may specify an optional event filter string. The filter string you specify will be used by the Broker when determining if an event should be placed in your Broker client's event queue.
Before an event is placed in your Broker client's event queue, it must meet these criteria:
1. The event type must match the subscription's event type.
2. The contents of the event must match the filter specification
The following example shows how to create an event filter string and use it with an event subscription:
BrokerClient c;
char *filter_string;
. . .
filter_string = "(A<B) and ((C+12) > (D*3))";
. . .
/* Make a subscription */
err = awNewSubscription(c,"Sample::SimpleEvent",filter_string);
if (err != AW_NO_ERROR) {
. . .
}
. . .