Udostępnij za pośrednictwem


Custom Event Providers

Custom event providers are custom components that submit event data to Notification Services applications. When developing a custom event provider, you must determine the type of event provider you will develop, the source for event data, and the API used to submit data.

Types of Custom Event Providers

Custom event providers can be hosted or non-hosted (independent). Hosted event providers are run by the Notification Services engine's provider host.

Hosted event providers can be easier to develop because they can leverage the Notification Services provider host. Also, hosted event providers can be enabled and disabled like other Notification Services components. For more information about developing hosted event providers, see Developing Hosted Event Providers.

Non-hosted event providers operate outside of the Notification Services system. They are useful if you have existing infrastructure that you want to use to submit events, or if you want to submit events on demand. For more information about developing non-hosted event providers, see Developing Non-Hosted Event Providers.

Collecting Event Data

There are many ways to gather data. For example, you can query a database, parse an XML file, or submit data through a Microsoft Windows or Web form. The trigger for collecting data can either be an action in the application that pushes data to the event provider or scheduled polling of a data source.

Knowing your data source, format, and collection model helps you choose an event submission API.

Event Submission APIs

When you have determined your data source, you can choose an event submission API. Notification Services has three event submission APIs:

  • If your data is available in XML, you can use the EventLoader class to write one or more events from the XML data source to the application database. The built-in file system watcher event provider uses the EventLoader class.
  • If your data is in a SQL Server database, you can use the event submission stored procedures to write individual events or gather and submit data using a Transact-SQL query. The built-in SQL Server event provider uses these stored procedures.
  • If you have any other event sources, you can use the managed event submission API. With this API, you create an Event object for each event, and then use an EventCollector object to collect the events into a batch and submit it to the application database.

In each of these APIs, events are submitted to the database in batches. They become visible to the application only when the event batch is committed.

The following diagram illustrates these event submission APIs:

Event processing architecture

Using Custom Event Providers

To use a custom event provider, you must declare it in the application definition. For more information, see Defining Event Providers.

See Also

Concepts

Using the Managed Event Submission API
Using the XML Event Loader API
Using Event Submission Stored Procedures

Other Resources

Developing a Custom Event Provider

Help and Information

Getting SQL Server 2005 Assistance