notification service 2005

23
Notification Services 2005

Upload: shram2k

Post on 14-Nov-2014

1.803 views

Category:

Technology


0 download

DESCRIPTION

An Insight of Notification Service 2005

TRANSCRIPT

Page 1: Notification Service 2005

Notification Services 2005

Page 2: Notification Service 2005

Agenda

• What is SQL Server Notification Services– Introduction

• Architecture– Sub scription Management– Event Providers– Generator– Distributor

• NS Instances and NS Application

Page 3: Notification Service 2005

Existing approach for receiving notifications

ResponseResponse

LOB, LOB, RptRpt

ERP, ERP, CRMCRM

NewsNews

WebWeb

My DeviceMy Device

RequestRequest

Getting Information - PULLNo notifications – connected requestor

Page 4: Notification Service 2005

Existing approach for receiving notifications

Getting Information - PUSH Push notifications – all or nothing

LOB, LOB, RptRpt

ERP, ERP, CRMCRM

NewsNews

WebWeb

My DeviceMy DevicePushPush

SPAM

Page 5: Notification Service 2005

Getting Information - NOTIFYNotifications – subscriber preference

LOB, LOB, RptRpt

ERP, ERP, CRMCRM

NewsNews

WebWeb

Notification Notification ApplicationApplication

A new class of applications A new class of applications that deliver that deliver personalized personalized and and timelytimely information to information to any deviceany device

My Device(s) My Device(s) of Choiceof Choice

Page 6: Notification Service 2005

SQL Notification Service

• Platform to develop and deploy rich, highly scalable notification applications

• Declarative programming model– Based upon XML and T-SQL

• Execution engine– Based upon SQL Server 2005 and

.NET Framework

Page 7: Notification Service 2005

Notification Service

Page 8: Notification Service 2005

Architecture Overview

Subscription Management ApplicationSubscription Management Application

Data Data ChangeChange

ss

Data Data ChangeChange

ss

ExternalExternalDeliveryDelivery

ExternalExternalDeliveryDelivery

SQL ServerSQL Server

Event ProviderEvent Provider

File System File System WatcherWatcher

SQL Server SQL Server providerprovider

Custom EPCustom EP

EventEventProviderProvider

HostHost

SQLSQLMatchMatchRuleRule

Executes Executes Stored ProcsStored Procs

GeneratorGenerator DistributorDistributor

XSLT XSLT CFCF

Custom CFCustom CF

XSLTXSLT

EmailEmail

.NET Alerts.NET Alerts * *

FileFile

Page 9: Notification Service 2005

Managing Subscriptions

Subscription Management ObjectsSubscription Management Objects

SubscribersSubscribers Subscribers Devices

Subscribers Devices SubscriptionsSubscriptions

Notification ServicesNotification Services

Instance DB Application DB

Subscription Mgt AppSubscription Mgt App Subscription Mgt AppSubscription Mgt App

Page 10: Notification Service 2005

Create Subscribers, Devices, & Subscriptions

using Microsoft.SqlServer.NotificationServices;string instanceName = “ABCPress";NSInstance myInstance = new NSInstance(instanceName); Subscriber mySubscriber = new Subscriber(myInstance);mySubscriber.SubscriberId = “[email protected]";mySubscriber.Add();

using Microsoft.SqlServer.NotificationServices;string instanceName = “ABCPress";NSInstance myInstance = new NSInstance(instanceName); Subscriber mySubscriber = new Subscriber(myInstance);mySubscriber.SubscriberId = “[email protected]";mySubscriber.Add();

INSERT INTO [ITM_NS_DEV].[ListingClosedBidAlerts].[NSSubListingSellerClosedBidView]

(SubscriberId, Enabled, UserName, DeviceName,SubscriberLocale) VALUES (@username, 1, @username,'CUSTOM DEVICE','en-US')

INSERT INTO [ITM_NS_DEV].[ListingClosedBidAlerts].[NSSubListingSellerClosedBidView]

(SubscriberId, Enabled, UserName, DeviceName,SubscriberLocale) VALUES (@username, 1, @username,'CUSTOM DEVICE','en-US')

SQLNS API

Views

Page 11: Notification Service 2005

Collecting Events

Event SourcesEvent Sources

Event ProvidersEvent Providers

StandardStandard CustomCustom

Notification ServicesNotification Services

Application DB

Page 12: Notification Service 2005

CODE…

Page 13: Notification Service 2005

Generator

• Matches Events and Subscriptions to generate NotificationsMatches Events and Subscriptions to generate Notifications

• Write “match rules” with full power of SQL Write “match rules” with full power of SQL (Transact-SQL, sp, transactions…)(Transact-SQL, sp, transactions…)

Events & Chronicles

Subscription Information

GeneratorGenerator

Notifications

Page 14: Notification Service 2005

CODE..

Page 15: Notification Service 2005

Distributor

• Periodically scans for notification batches

• Formats raw notification data to message body

• Assembles formatted notifications into protocol packets

• Delivers the protocol packet

• Handles delivery failures

Page 16: Notification Service 2005

CODE…

From Application Definition file:

Page 17: Notification Service 2005

CODE..

From Instance Configuration file:

Page 18: Notification Service 2005

Instance Configuration File

<?xml version="1.0" encoding="utf-8"?><NotificationServicesInstance

xmlns:xsd="http://www.w3.org/2001/XMLSchema...<!--Instance name--><InstanceName >ABCOwners</InstanceName><!--Sql server--><SqlServerSystem>%SqlServer%</SqlServerSystem><!--Database information--><Database> …</Database><!--Applications associated with this instance--><Applications>…</Applications><!--Delivery Channels available--><DeliveryChannels>…<DeliveryChannels>…

</NotificationServicesInstance>

<?xml version="1.0" encoding="utf-8"?><NotificationServicesInstance

xmlns:xsd="http://www.w3.org/2001/XMLSchema...<!--Instance name--><InstanceName >ABCOwners</InstanceName><!--Sql server--><SqlServerSystem>%SqlServer%</SqlServerSystem><!--Database information--><Database> …</Database><!--Applications associated with this instance--><Applications>…</Applications><!--Delivery Channels available--><DeliveryChannels>…<DeliveryChannels>…

</NotificationServicesInstance>

Page 19: Notification Service 2005

Application Definition File

<?xml version="1.0" encoding="utf-8" ?><Application xmlns:xsd="http://www.w3.org/2001/XMLSchema"

xmlns:xsi="http://...<!--Application database information--><Database>…</Database><!--Event class definitions--><EventClasses>…</EventClasses><!--Subscription class definitions--><SubscriptionClasses>…</SubscriptionClasses><!--Notification class definitions--><NotificationClasses>…</NotificationClasses><!--Event Providers--><Providers>…</Providers>….

</Application>

<?xml version="1.0" encoding="utf-8" ?><Application xmlns:xsd="http://www.w3.org/2001/XMLSchema"

xmlns:xsi="http://...<!--Application database information--><Database>…</Database><!--Event class definitions--><EventClasses>…</EventClasses><!--Subscription class definitions--><SubscriptionClasses>…</SubscriptionClasses><!--Notification class definitions--><NotificationClasses>…</NotificationClasses><!--Event Providers--><Providers>…</Providers>….

</Application>

Page 20: Notification Service 2005

XSLT Content Formatter

XSLT Content Formatter<?xml version="1.0" encoding="UTF-8" ?><xsl:stylesheet version="1.0"

xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

XSLT Content Formatter<?xml version="1.0" encoding="UTF-8" ?><xsl:stylesheet version="1.0"

xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

Page 21: Notification Service 2005

Summary

• Notification Services is a platform

• Enables rapid development of robust scalable Notification Applications

• Easy to use Declarative Programming Model

• A True .Net Enterprise Server Product

Page 22: Notification Service 2005

Additional Resources

•Online

•Books

• http://www.microsoft.com/sql/ns

• microsoft.public.sqlserver.notificationsvcs

• MSDN Forums

• http://weblogs.sqlteam.com/joew

• http://www.microsoft.com/sql/ns

• microsoft.public.sqlserver.notificationsvcs

• MSDN Forums

• http://weblogs.sqlteam.com/joew

• Microsoft SQL Server 2005 Notification Services by Shyam Pather

• Rational Guide to SQL Server Notification Services by Joe Webb

• Microsoft SQL Server 2005 Notification Services by Shyam Pather

• Rational Guide to SQL Server Notification Services by Joe Webb