notification service 2005

Post on 14-Nov-2014

1.803 Views

Category:

Technology

0 Downloads

Preview:

Click to see full reader

DESCRIPTION

An Insight of Notification Service 2005

TRANSCRIPT

Notification Services 2005

Agenda

• What is SQL Server Notification Services– Introduction

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

• NS Instances and NS Application

Existing approach for receiving notifications

ResponseResponse

LOB, LOB, RptRpt

ERP, ERP, CRMCRM

NewsNews

WebWeb

My DeviceMy Device

RequestRequest

Getting Information - PULLNo notifications – connected requestor

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

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

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

Notification Service

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

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

Create Subscribers, Devices, & Subscriptions

using Microsoft.SqlServer.NotificationServices;string instanceName = “ABCPress";NSInstance myInstance = new NSInstance(instanceName); Subscriber mySubscriber = new Subscriber(myInstance);mySubscriber.SubscriberId = “bess@webbtechsolutions.com";mySubscriber.Add();

using Microsoft.SqlServer.NotificationServices;string instanceName = “ABCPress";NSInstance myInstance = new NSInstance(instanceName); Subscriber mySubscriber = new Subscriber(myInstance);mySubscriber.SubscriberId = “bess@webbtechsolutions.com";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

Collecting Events

Event SourcesEvent Sources

Event ProvidersEvent Providers

StandardStandard CustomCustom

Notification ServicesNotification Services

Application DB

CODE…

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

CODE..

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

CODE…

From Application Definition file:

CODE..

From Instance Configuration file:

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>

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>

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">

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

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

– Feedback - www.techepitome@blogspot.com

top related