Using the CORBA Notification Service
SubscriptionID subscribe (
in string subscription_name,
in RegularExpression domain,
in RegularExpression type,
in FilterExpression data_filter,
// The filter expression must length 1 and the name must
// be TRANSIENT_SUBSCRIPTION or PERSISTENT_SUBSCRIPTION.
in CosNotification::QoSProperties qos,
in CosNotifyComm::StructuredPushConsumer push_consumer
);
For a description of the parameters supported by this operation, see "Parameters Used When Creating Subscriptions" on page -11.
Indicates one of the following problems:Tobj_Events::SUB_INVALID_FILTER_EXPRESSION
Tobj_Events::SUB_UNSUPPORTED_QOS_VALUE
Note: For more information on exceptions and corresponding minor codes, see "Exception Minor Codes" on page -59.
Use this operation to subscribe to events. This operation is called by a subscriber application on the Notification Service to create a subscription to a particular event. The subscription name, domain name, type name, data filter, quality of service, and the object reference of the subscriber's callback object are passed in. The callback object implements the CosNotifyComm::StructuredPushConsumer IDL interface.
Note: For subscribers that shut down and restart, you must write the subscription_id
to persistent storage.
To use data filtering or subscribe to BEA Tuxedo system events or events posted by a BEA Tuxedo application, see the sections "Creating FML Field Table Files for Events" on page -7 and "Interoperability with BEA Tuxedo Applications" on page -9.
Returns a unique subscription identifier. The effect of this operation is not instantaneous. There can be a delay between returning from this operation and the actual start of event delivery. The length of the delay period may be significant depending on your configuration. For more information on factors impacting this delay period, see "Synchronizing Databases" on page -23.
Note: Notification Service applications that start and shut down only once can use the subscription_id
to determine if their subscription has been cancelled automatically or by the system administrator.
Note: Code examples shown here are abbreviated. For complete code examples, see "Creating a Subscription" on page -8.
subscription_id = channel->subscribe(
subscription_name,
"News", // domain
"Sports", // type
"", // No data filter.
qos,
news_consumer.in()
);