|
A Notification Services application is a software layer that sits between an information
source and the intended recipient of that information. The Notification Services
application monitors certain predefined events and can intelligently filter and route
the information about those events to a variety of different target devices using
a personalized delivery schedule. Notification Services applications consist of three
basic components: events, subscriptions, and notifications.
Events
In a Notification Services application, events are just what they sound like—things
happening that you want to be informed about. In the case of the NASDAQ, an event
might be a given stock price rising to a certain level. In a typical database application
an event could be associated with the value of a given column. Here the event would
be fired if the column’s value passed a certain predefined threshold.
Event Providers
A Notification Services application monitors for events using an event provider.
There are three types of Notification Services event providers: hosted, non-hosted,
and standard event providers.
Hosted Providers Hosted event providers are directly executed by Notification
Services. When Notification Services starts, it automatically initializes and runs
enabled hosted event providers.
Non-Hosted Providers Non-hosted event providers are external applications that do
not run within the Notification Services process. Non-hosted event providers post
event data to a Notification Services application using the EventCollector class; the
EventLoader class; or the NseventBeginBatch, NSEventWrite, or NSEventFlushBatch
stored procedures.
Standard Providers SQL Server 2005 ships with a base set of standard event providers
that you can readily use to build Notification Services applications. Notification
Services provides the following event providers:
- File System Watcher The File System Watcher event provider monitors the
. le system and is triggered when a . le is added to the monitored directory. It
reads the directory contents into memory and then writes event information to
the event table.
- SQL Server The SQL Server event provider uses a T-SQL query to specify
database data that will be monitored. It then uses Noti. cation Services–
provided stored procedures to create events based on this new or updated data
and then write these events to the event table.
- Analysis Services The Analysis Services event provider uses a static or
dynamic MDX query to gather data from an Analysis Services cube and submit
the data as events to an application.
Subscriptions
Subscriptions correlate users and the types of events that they are interested in. For
example, with the NASDAQ example, a user might create a subscription to get a
notification when a given stock price drops below $50 per share. SQL Server 2005’s
Notification Services stores subscriptions, like events, as rows in a table.
Notifications
The notification is essentially a message that will be sent to the end user that contains
the information regarding the event that the user subscribed to. Notifications can be
delivered in various formats to a variety of different target devices, including XML,
HTML, e-mail, WAP, and other formats.
Notification Engine
The Notification Services engine receives external events from the event provider and
looks for matches between events and registered subscriptions. When an event matches
a subscription, the Notification Services engine sends a notification to the end user.
The scalability of a Notification Services application depends in a large part on
how well the Notification Services engine matches events to subscriptions. Microsoft
has designed the underlying Notification Services framework to be scalable at
an Internet level, meaning that with the appropriate platform, SQL Server 2005’s
Notification Services can scale upward to handle millions of events, subscriptions,
and notifications. To do that, Notification Services takes advantage of SQL Server
2005’s efficient relational database engine to join the rows from the events table with
the rows in the subscriptions table in order to match events to subscriptions. |