![]() |
![]() |
|
|
Subscribing to Events
The tpsubscribe(3c) function enables a BEA Tuxedo system ATMI client or server to subscribe to an event.
A subscriber can be notified through an unsolicited notification message, a service call, a reliable queue, or other notification methods configured by the application administrator. (For information about configuring alternative notification methods, refer to Setting Up a BEA Tuxedo Application.)
Use the following signature to call the tpsubscribe() function:
long handle
tpsubscribe (char *eventexpr, char *filter, TPEVCTL *ctl, long flags)
The following table describes the arguments to the tpsubscribe() function.
tpsubscribe( ) Function Arguments
You can subscribe to both system- and application-defined events using the tpsubscribe() function. For purposes of subscriptions (and for MIB updates), service routines executed in a BEA Tuxedo system server process are considered to be trusted code. Notification via Unsolicited Message If a subscriber is a BEA Tuxedo system client process and ctl is NULL, when the event to which the client has subscribed is posted, the EventBroker sends an unsolicited message to the subscriber as follows. When an event name is posted that evaluates successfully against eventexpr, the EventBroker tests the posted data against the associated filter rule. If the data passes the filter rule (or if there is no filter rule for the event), then the subscriber receives an unsolicited notification along with any data posted with the event. In order to receive unsolicited notifications, the client must register an unsolicited message handling routine using the tpsetunsol() function. ATMI clients receiving event notification via unsolicited messages should remove their subscriptions from the EventBroker list of active subscriptions before exiting. This is done using the tpunsubscribe() function. Notification via Service Call or Reliable Queue Event notification via service call enables you to program actions that can be taken in response to specific conditions in your application without human intervention. Event notification via reliable queue ensures that event data is not lost. It also provides the subscriber the flexibility of retrieving the event data at any time. If the subscriber (either a client or a server process) wants event notifications sent to service routines or to stable-storage queues, then the ctl parameter of tpsubscribe() must point to a valid TPEVCTL structure. The TPEVCTL structure contains the following elements: The following table summarizes the TPEVCTL typed buffer data structure. TPEVCTL Typed Buffer Format
long flags;
char name1[32];
char name2[32];
TPQCTL qctl;
![]() |
![]() |
![]() |
|
Copyright © 2001 BEA Systems, Inc. All rights reserved.
|