all groups > sql server notification services > february 2007 >
You're in the

sql server notification services

group:

Notifying on latest event only?


Notifying on latest event only? Andy
2/12/2007 12:22:20 PM
sql server notification services: Hi,

I have an event which may come into the Ns system. The event is a
release of software. A new version can sometimes be released two or
three times in a week. In that case, I only want to deliver the last
event and discard the rest.

Is there a way I can do this with the built in capabilities, or do I
have to build a custom delivery channel?

Thanks
Andy
Re: Notifying on latest event only? Joe Webb
2/13/2007 5:44:23 AM
[quoted text, click to view]

Event driven subscriptions will produce a notification
with each release, which is not what you want. So in case you'll want
to use scheduled subscriptions so that you can control when they go out.

You'll also want to employ a chronicles table to keep track of the "high
watermark" for the software release. Have the event provider update the
chronicles table, recording the most recent release of the software
product.

The match rule should match only the "high watermark" for reach software
release with those subscribers who are interested in the information.

At the risk of sounding like I'm shamelessly promoting my book...chapter
7 of it does going into detail about how to creatively use chronicles
tables to minimize uninteresting notifications. If you have it, check
there. If you don't have the book, keep asking questions here and we'll
get it worked out.

HTH...

Joe





--
Joe Webb
SQL Server MVP
http://www.sqlns.com



Re: Notifying on latest event only? Andy
2/13/2007 6:43:07 AM
[quoted text, click to view]

Yes, I already have setup the scheduled subscriptions.

[quoted text, click to view]

I have chronicles to keep track of the scheduled subscriptions, its
how to keep the 'high watermark' that is eluding me. Is it save to
update data already contained within the table? I also don't want to
update events that have already been used to generate notifications..

[quoted text, click to view]

Sounds tricky.. I guess the match rule will have to look for the high
water mark from this past week only?

[quoted text, click to view]

I think I will pick it up.. I was waiting for you to update it to the
Sql 2005 version.. I'm still trying to get my head around NS and I
wanted to avoid confusing myself with how things were done in the 2.0
version, but it sounds like what I need to do hasn't been affected
much by the changes in 2005.
Re: Notifying on latest event only? Andy
2/15/2007 12:03:56 PM
Hi,

Instead of a TimeAdded column, I added a WeekAdded column and track
only the week in which the event was submitted. Then if a new event
for the same software comes in, it updates the existing event if it is
within the same week.

Does this sound like an appropriate solution?

Thanks
Andy

[quoted text, click to view]
Re: Notifying on latest event only? Joe Webb
2/16/2007 4:55:11 AM
[quoted text, click to view]

That should work. Good solution. Just make sure the match rule matches
the subscriber to the release they are interested for the current week.

BTW - Remember that the Chronicles are subject to the vacuumer so you'll
need to create a job to clean up the older rows when they are no longer
needed. I certainly wouldn't worry about doing this weekly; perhaps only
quarterly or even annually.




--
Joe Webb
SQL Server MVP
http://www.sqlns.com



Re: Notifying on latest event only? Andy
2/16/2007 5:35:03 AM
Seems to work ok, except it seems that it sends multiple
notifications. I'm still looking into that, it could just be that the
older events were reprocessed when I recreated the chronicle tables.

I also have your book on the way; I hope you will decide to update it
for 2005 though.

Andy

[quoted text, click to view]
AddThis Social Bookmark Button