Notification Services Programming Framework
The Notification Services programming framework facilitates quick notification application development using XML or managed code and Transact-SQL.
The primary tasks for application development are to define application properties and to configure an instance that hosts the application. Depending on the event providers, delivery protocols, and content formatters used by your applications, you might have some additional development tasks, such as defining XML schemas (XSDs), Extensible Stylesheet Language Transformation (XSLT) files, or custom components.
Most applications also require a custom subscription management interface.
The Notification Services programming framework supports two methods for defining applications and configuring instances:
You can define applications and configure instances in XML files, called application definition files (ADFs) and instance configuration files (ICFs), respectively. XML reference topics are available in the Notification Services Programming Reference.
You can programmatically define applications and configure instances using Notification Management Objects (NMO). The NMO objects are in the Microsoft.SqlServer.Management.Nmo namespace.
For sample applications, see SQL Server Notification Services Samples.
An application definition documents application properties. When you define a Notification Services application, you typically perform the following tasks:
Define the structure of application events.
Define the structure of application subscriptions, and define the queries that join event data and subscription data to produce notifications.
Define the structure of the resulting notifications, the notification content formatter, the delivery protocols used to deliver notifications, and delivery settings, such as a retry schedule.
Define the event providers that collect and submit event data to the application.
Configure the interval for running the generator.
Define the distributors that govern formatting and distribution.
Define the application database, which can be a new or existing database.
Define operational settings for the application.
For more information about defining applications, see Defining Notification Services Applications.
Depending on the application definition, you may need to create additional files. For example, if you use the file system watcher event provider, you must create an XSD file that defines the XML event schema. If you choose to format notifications using the XSLT content formatter, you must create one or more XSLT files that convert raw notification data into a readable message.
Also, if the standard event providers, content formatter, or delivery protocols do not meet the requirements of your application, you can develop custom components. For more information, see Developing Custom Notification Services Components.
A Notification Services instance is a named configuration that hosts one or more applications. The configuration file defines the name of the instance, defines the instance database, names the applications hosted by the instance, and configures databases, protocols, and delivery channels for the instance.
For more information about configuring instances, see Configuring Instances of Notification Services.
When you are ready to test your Notification Services application, you must compile the instance, which creates instance and application databases. You must then register, enable, and start the instance, and then submit test data to determine if your application is working as expected.
Compiling a Notification Services instance is very similar to deploying the instance. For more information about deploying instances of Notification Services, see Deploying Notification Services.
If you want to test the application without using event providers and subscription management interfaces, Notification Services provides stored procedures and views to make testing easier:
For each event class you define in your application, Notification Services creates a view with the same name as the event class. You can submit events into these views. For more information, see <EventClassName> View.
You can also use the event submission stored procedures, which are documented in the Notification Services Stored Procedures (Transact-SQL) section.
For each subscription class that you define, Notification Services creates a view with the same name as the subscription class. You can use these views to submit subscriptions. For more information, see NSSubscriberView.
For each notification class that you define, Notification Services creates a view with the same name as the notification class. You can use these views to review notifications produced by your application. For more information, see <NotificationClassName> View.
For more information about the options available for deploying and running instances of Notification Services, see Notification Services Deployment Options.
Most Notification Services applications obtain subscription data through custom subscription management interfaces that subscribers can use to create subscriptions. These interfaces are often Web or Windows applications.
You can develop subscription management interfaces using the Notification Services subscription management API. For more information, see Developing Subscription Management Interfaces.