all groups > sql server notification services > may 2005 >
You're in the

sql server notification services

group:

Building Notification Applications on the fly..


RE: Building Notification Applications on the fly.. nattyravi
5/23/2005 3:09:59 PM
sql server notification services:
Hi, Small correction in my question. By adding <Application> block to
<Applications> to appConfig.xml and <EventClass>, <SubscriptionClass>,
<NotificationClass> blocks to appADF.xml at runtime, can I actually create a
new application at run-time? I need my notification service to accept any
kind of subscription. Please let me know how to do it.

Regards,
Ravi

[quoted text, click to view]
Building Notification Applications on the fly.. nattyravi
5/23/2005 3:11:12 PM
Hi,
I am trying to use notification services to generate notifications to any
subscribers. By that I mean, a stock subscriber can subscribe for email if
stock price for stock symbol goes above some value, an order handling person
can subscribe for SMS if inventory level goes below some limit, etc. But
these subscriptions, notification event rules should be created on the fly
rather than at design time. Because there may be 20, 30 scenarios where the
subscribers come for notification service with a different need and i can't
actually create the app.Config at design time. If i create the app.Config at
runtime, it will recreate the databases and the previous data of other
subscribers is lost i.e., when a different subscriber requests a new
subscripton that requires addition of subscription class, notificationclass,
and eventclass to the app.Config. Please suggest me how to solve this
problem. Please respond quickly.

Regards,
Ravi

Re: Building Notification Applications on the fly.. Joe Webb
5/23/2005 8:28:54 PM

Hi Ravi -

Take a look a this thread:

http://groups-beta.google.com/group/microsoft.public.sqlserver.notificationsvcs/browse_thread/thread/12e312489faf9e27/f8c7254f2bee5e95?q=dynamic&rnum=8#f8c7254f2bee5e95


--
Joe Webb
SQL Server MVP


~~~
Get up to speed quickly with SQLNS
http://www.amazon.com/exec/obidos/tg/detail/-/0972688811

I support PASS, the Professional Association for SQL Server.
(www.sqlpass.org)



On Mon, 23 May 2005 15:11:12 -0700, nattyravi
[quoted text, click to view]
Re: Building Notification Applications on the fly.. nattyravi
5/23/2005 11:48:01 PM
Hi Joe Webb,
Thanks for the link. It was very helpful. As I understand from the content
there, the SQL Server 2000 notification service is not flexible enough to
achieve this functionality. There is a performance cost for doing it. The
query would have lots of conditions or there will be too many queries to
evaluate (based on number of subscriptions). I too feel the SQL Server 2000
notification service is tightly-coupled in this aspect of dynamic addition of
applications to it.

One thing i found while trying to add an <application> to appConfig.xml
and <SubscriptionClass>, <NotificationClass> to appADF.xml at runtime is, the
NS$Instance windows service of NS is stopping and restarting. This is
happening whenever changes are done to appConfig.xml and 'NSControl update'
cmd is called. I feel in a production environment this could have a serious
performance problem since the NS$Instance service polls for events to create
notifications and if there are many new different subscriptions coming at
around same time, the poller (NS$Instance service) would be off(and on) most
time and will not meet any of the notification times specified during that
period by previous subscribers. Isn't it correct? Please correct me if I am
wrong.

Regards,
Ravi



[quoted text, click to view]
Re: Building Notification Applications on the fly.. Joe Webb
5/24/2005 10:09:28 AM
Hi Ravi -

See my comments inline.

--
Joe Webb
SQL Server MVP


~~~
Get up to speed quickly with SQLNS
http://www.amazon.com/exec/obidos/tg/detail/-/0972688811

I support PASS, the Professional Association for SQL Server.
(www.sqlpass.org)



On Mon, 23 May 2005 23:48:01 -0700, nattyravi
[quoted text, click to view]

JW - Well, I wouldn't put it that way. SQLNS is very flexible and can
be adapted to handle many, many different requirements. Part of that
flexibility includes being able to scale up to very high volume
implementations. However, user defined rules is not something that the
current version sought to address. Attempting to do so in this
implementation would likely decrease the scalability.


[quoted text, click to view]

JW - Absolutely! Rebuilding the application periodically would
definitely affect performance.

[quoted text, click to view]

JW - Consider re-reading Shyam's comments at the end of the thread
that I posted last time. I agree with him. Many people go into SQLNS
thinking that they need user defined rules, but upon further
consideration they discover that with a bit of creative work, they can
create a much better and certainly more scalable solution without
them.

[quoted text, click to view]

JW - Yes to update a SQLNS instance, the service must be stopped; no
way around that. Also be very careful in the way that update the ADF.
For example, if you change a subscription class, NSControl renames the
existing table and creates a new one with the new schema. That's good,
but it means that you must manually transfer that existing
subscriptions to the new subscription table.

[quoted text, click to view]


JW - After being stopped, SQLNS will attempt to catch up on missed
notifications. It depends on how your recognizing events as to whether
it'll capture events that happened during it's down time.

Again, I'd really encourage you to look into create a
super-subscription with optional parameters. It'll be much more
robust, scalable, and less problematic.

On a side note, I'm sure that MS is listening to requests like this
and will take it into consideration for future releases. You can also
submit your request via sqlwish@microsoft.com.
[quoted text, click to view]
Re: Building Notification Applications on the fly.. tarpan
5/24/2005 11:31:01 AM
[quoted text, click to view]
achieve this functionality.

:-(
I have the same task.
I have the same result : the SQL Server 2000 notification service is not
flexible enough to achieve this functionality.

[quoted text, click to view]

Unfortunately, it has to be adapted MANUALLY. I have to manually create all
the rules, but I have no idea yet what notifications my customers will want.
I will have to get back to my NS app again and again to add and modify the
rules that they want instead of let them do it.

Disappointing.....
:-(


Re: Building Notification Applications on the fly.. tarpan
5/24/2005 11:37:09 AM
[quoted text, click to view]

I have over 100 user-related tables in the DB. How the super SQL may look? ;-)

What I trying to do so far - it's break one super-SQL to over 100
Re: Building Notification Applications on the fly.. tarpan
5/24/2005 11:41:05 AM
[quoted text, click to view]
requirements.

BTW, can it be adapted to let adminitrator change the notification text
Re: Building Notification Applications on the fly.. tarpan
5/24/2005 12:01:02 PM
Sure I can not! If I could - I could just implement those rules.

The our Apllication works with the hudreds of entities (grain, bins,
facilities, prices, stocks, transportation units, rail cars and unittrans,
barges, grades grades factors, divisions and regions....). A lot ... Each
entities can possible have several related events. Many events may be
generated on the intersection of the several entities, and so on. Thousands
of possible variations.

So, I do not know "kinds of notifications my customers will want".



[quoted text, click to view]
Re: Building Notification Applications on the fly.. tarpan
5/24/2005 12:17:29 PM
[quoted text, click to view]

Hmm.
I tried. Restarting the service does not help.


[quoted text, click to view]

Re: Building Notification Applications on the fly.. nattyravi
5/24/2005 12:53:06 PM
Hi Guys,
Thanks for your comments. From what I have understood, if I were to provide
high-level method calls like the ones below, it will not work (or maybe,
requires lot of tweaking of NS).

1. MsgSchemaId AddMessage(schema, MsgName)

eg: AddMessage(Stockschema, "Stock") - This creates a stock application if
not exists, otherwise just adds a new subscription to stock application.
Technically, in the first case, it adds application in appConfig.xml and
subscription class, notification class, event class to appADF.xml and in the
later case, it just adds subscription class, notification class, event class
to appADF.xml. This method returns a MsgSchemaId that is used below 2
methods. This above method is called by the end-user(i.e., subscriber).

2. bool AddCriterion(SubscriberId, MsgSchemaId, SQLstrCriterion)

This returns true if sql criterion is successfully applied to specified
message schema. For stock schema, the criterion might be to get MSFT stock
notification when MSFT gets over $25 stock value. This method is called by
the end-user(i.e., subscriber).


3. bool AddTransform(SubscriberId, MsgSchemaId, DeviceId, TransformXSLTfile)

This returns true if the XSLT file is successfully applied to message
schema's notification content. The XSLT file is specific to subscriber and
his device. This method is called by the end-user(i.e., subscriber).

I want to know whether it is advisable to design the application this way,
assuming i work hard to achieve this generic interface.

Thanks in advance,
Ravi

[quoted text, click to view]
Re: Building Notification Applications on the fly.. Joe Webb
5/24/2005 1:38:48 PM
Can you elaborate or provide examples of the kinds of notifications
your customers will want?

--
Joe Webb
SQL Server MVP


~~~
Get up to speed quickly with SQLNS
http://www.amazon.com/exec/obidos/tg/detail/-/0972688811

I support PASS, the Professional Association for SQL Server.
(www.sqlpass.org)


On Tue, 24 May 2005 11:31:01 -0700, tarpan
[quoted text, click to view]
Re: Building Notification Applications on the fly.. Joe Webb
5/24/2005 1:53:20 PM
No and yes. ;)

No in that if you use the built in XSLT content formatter, you have to
restart the service or disable/enable the distributor in order to
refresh the cached copy of the transform.

But yes, in that you don't have to use the XSLT content formatter. You
can create your own that does whatever you want it to, including not
caching the 'template'.

HTH...

--
Joe Webb
SQL Server MVP


~~~
Get up to speed quickly with SQLNS
http://www.amazon.com/exec/obidos/tg/detail/-/0972688811

I support PASS, the Professional Association for SQL Server.
(www.sqlpass.org)



On Tue, 24 May 2005 11:41:05 -0700, tarpan
[quoted text, click to view]
Re: Building Notification Applications on the fly.. Joe Webb
5/24/2005 2:36:32 PM
Start with Custom Content Formatters in BOL.

If you need more info, Shyam Pather's book is excellent. I don't have
it in front of me at the moment so I cannot tell you how much space is
devoted to custom content formatters, but generally speaking it's a
book you'll like to have if you work with SQLNS.


--
Joe Webb
SQL Server MVP


~~~
Get up to speed quickly with SQLNS
http://www.amazon.com/exec/obidos/tg/detail/-/0972688811

I support PASS, the Professional Association for SQL Server.
(www.sqlpass.org)


On Tue, 24 May 2005 12:17:29 -0700, tarpan
[quoted text, click to view]
Re: Building Notification Applications on the fly.. nattyravi
5/24/2005 4:38:01 PM
Hi Joe,
Thanks for all your suggestions. They are very helpful. I will be meeting
Shyam Pather next week and talk about these design issues in mind. If you
have any suggestions to add up, please let me know so that I will present to
him. Since I am also in redmond and work for microsoft, this meeting is being
worked out. I will be meeting him and I hope some kind of solution will found
for this design without changing the requirement.

Regards,
Ravi

[quoted text, click to view]
Re: Building Notification Applications on the fly.. tarpan
5/25/2005 6:25:44 AM
What is the BOL, by the way?

[quoted text, click to view]
Re: Building Notification Applications on the fly.. Joe Webb
5/25/2005 8:41:46 AM
BOL is a shorthand way of saying Books Online for those of us who type
ineffeciently; it's the online help/documentation that comes with the
product.

--
Joe Webb
SQL Server MVP


~~~
Get up to speed quickly with SQLNS
http://www.amazon.com/exec/obidos/tg/detail/-/0972688811

I support PASS, the Professional Association for SQL Server.
(www.sqlpass.org)



On Wed, 25 May 2005 06:25:44 -0700, tarpan
[quoted text, click to view]
Re: Building Notification Applications on the fly.. Joe Webb
5/25/2005 8:50:42 AM
Hi Ravi -

Ahh...very good. I was recently asked during a presentation at a
conference in Munich, Germany, if Microsoft is using SQLNS for
anything internally, but I didn't have a good answer, except of course
MSN. If you put something into production and could share at a very
high level what it's doing, I would greatly appreciate it. If the news
groups is not the best forum for that, you can email me directly.

Let me give some thought to your question about the meeting. BTW - I'm
going to be on vacation next week and will not be online to follow up
until the following week.

And, finally if you and Shyam come up with a design concept to effect
your implementation, I'd love to hear some of the details if that's
something you can share. Again if the newsgroups are not the best
forum for the discussion you can email me directly.
joew@webbtechsolutions.com.

Thanks Ravi!


--
Joe Webb
SQL Server MVP


~~~
Get up to speed quickly with SQLNS
http://www.amazon.com/exec/obidos/tg/detail/-/0972688811

I support PASS, the Professional Association for SQL Server.
(www.sqlpass.org)


On Tue, 24 May 2005 16:38:01 -0700, nattyravi
[quoted text, click to view]
Re: Building Notification Applications on the fly.. tarpan
5/25/2005 9:13:04 AM
Thanks

[quoted text, click to view]
Re: Building Notification Applications on the fly.. Shyam Pather [MSFT]
5/25/2005 10:35:17 AM
Earlier in this thread, Joe posted a link to a previous thread in which a
solution to this problem was discussed. Here it is again:

http://groups-beta.google.com/group/microsoft.public.sqlserver.notificationsvcs/browse_thread/thread/12e312489faf9e27/f8c7254f2bee5e95?q=dynamic&rnum=8#f8c7254f2bee5e95

This was dismissed as too much of a performance hit, but unless you really
have millions of subscriptions, it should work out just fine. I suggest you
try this approach out - it shouldn't take very long to build a prototype -
and see the results for yourself. This has been used in practice and seems
to work out for many customers.
-shyam

--
Learn more about SQL-NS:
http://www.amazon.com/exec/obidos/tg/detail/-/0672326647/
---------------------------------------------
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm.
---------------------------------------------
[quoted text, click to view]

Re: Building Notification Applications on the fly.. Shyam Pather [MSFT]
5/25/2005 10:35:49 AM
Surely you can come up with some examples, if not an exhaustive list. That
would help us help you design a solution.

--
Learn more about SQL-NS:
http://www.amazon.com/exec/obidos/tg/detail/-/0672326647/
---------------------------------------------
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm.
---------------------------------------------
[quoted text, click to view]

Re: Building Notification Applications on the fly.. Shyam Pather [MSFT]
5/25/2005 10:36:49 AM
Thanks for the kind words, Joe. Chapter 9 in my book is devoted to content
formatters and has a detailed section on building custom implementations.
Thanks
-shyam

--
Learn more about SQL-NS:
http://www.amazon.com/exec/obidos/tg/detail/-/0672326647/
---------------------------------------------
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm.
---------------------------------------------
[quoted text, click to view]

Re: Building Notification Applications on the fly.. Shyam Pather [MSFT]
5/25/2005 11:00:37 AM
Joe,
To answer your question about Microsoft using NS internally, I can say the
following:
- Many of the MSN properties use it (MSN Mobile, MSN Autos, MSNBC news)
- Many internal (intranet) applications use it e.g. our intranet HR portal,
our MS Library News service
- Other product teams have integrated NS into solutions they sell to
customers e.g. MOM 2005, BizTalk
- Parts of microsoft.com will be using it soon e.g. the download center.

-shyam

--
Learn more about SQL-NS:
http://www.amazon.com/exec/obidos/tg/detail/-/0672326647/
---------------------------------------------
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm.
---------------------------------------------
[quoted text, click to view]

AddThis Social Bookmark Button