Summary


Delivery protocols are the components that handle notification delivery in SQL-NS applications. SQL-NS provides two built-in delivery protocols, File and SMTP. SQL-NS also provides an extensibility mechanism by which you can build your own custom delivery protocols. You may also be able to obtain custom delivery protocols from a vendor.

Delivery protocols are hosted in the distributor and implement various delivery methods that can be used to send notifications. Delivery channels represent specific delivery endpoints to which delivery protocols send notifications. Subscriber device records provide the link between notifications and the delivery channels that should be used to deliver them.

Delivery channels are declared in the ICF and reference delivery protocol names. Custom delivery protocols must be declared in the ICF before they can be used in delivery channels. To use a delivery protocol with a notification class, you must declare support for the protocol in the notification class declaration.

Notifications are grouped into notification batches when they are produced by the generator. The distributor selects notification batches that are ready for distribution and divides them into smaller groups called distributor work items. Each distributor work item contains the notifications in a batch going to a single delivery channel. Distributor work items form independent units of work for the application's distributors.

During the processing of a work item, the distributor reads notifications from the notifications table and passes them to a content formatter. The output of the content formatter is passed to a delivery protocol, along with information about the intended recipients and the values of any protocol fields. The delivery protocol sends the notifications to a delivery endpoint and reports their delivery status back to the distributor.

You can specify how failed notifications should be retried, by defining retry schedules in the ADF. If a notification delivery attempt fails, the distributor will retry the processing of the work item to which it belongs, on the schedule specified. Retry attempts on the work item will continue until all deliveries succeed, the retry schedule is exhausted, or the undelivered notifications expire. Notification expiration ages can be set in the ADF. The distributor maintains a log of all delivery attempts on each notification and makes this log available through views in the application database.

In this chapter, we added support to the music store application for the SMTP delivery protocol. To do this, we created a delivery channel that uses the SMTP protocol and added configuration information for the protocol to the NewSong notification class. We tested the application with the SMTP protocol and observed the resulting email notifications.

We also built a custom delivery protocol that uses Message Queuing to deliver notifications. We looked at the IDeliveryProtocol interface by which the SQL-NS engine interacts with delivery protocols and then wrote the code for a class that implements this interface. We tested the custom delivery protocol by integrating it into the SQL-NS instance and using a test program to listen for notifications on the message queue.

The work done in this chapter completes the functionality of the music store application. In the remaining chapters of this book we will look at how to tune this application for optimal performance and deploy it in a production environment.




Microsoft SQL Server 2005 Notification Services
Microsoft SQL Server 2005 Notification Services
ISBN: 0672327791
EAN: 2147483647
Year: 2006
Pages: 166
Authors: Shyam Pather

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net