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

sql server notification services

group:

<NonHostedProvider>


<NonHostedProvider> Anthony Small
2/3/2005 2:54:03 PM
sql server notification services:
Hi All,

I've created a simple app based on the Stock App that has a
NonHostedProvider named GenericProvider. I use this Provider reference when
I am manually submitting sample/test events. The app successfully writes the
notifications to a file but I don't understand how this nonhosted provider
works! It only exists in the <NonHostedProvider> node and in my test script
when I submit an event. I can't see how it works!

It is not a custom provider for which I have written code!
There is very little info that I can find about this in BOL.

Can anyone explain how nonhosted providers work, please?

TIA

Tony S.

Re: <NonHostedProvider> Colin Meek [MSFT]
2/4/2005 7:12:21 AM
Hi Tony,

Both hosted and non-hosted event providers insert events into the
Notification Services event queue. Hosted providers are called by NS on a
fixed schedule. Non-hosted providers can submit events whenever they like.

Non-hosted providers are identified by name in the application definition
file only so that they can identify themselves to the NS service when
submitting events. No other information is required in the provider
definition. Any process with the appropriate security permissions and with
the provider name is then able to submit events to the NS application.

Events inserted into the queue, whether by a hosted or non-hosted provider,
are treated in the same way. When the "generator" component processes
events -- on a schedule independent of the event submission timing -- it
processes all events arriving within a specific time window. This window is
determined by the generator "quantum" configuration.

More information on the event collection architecture can be found at:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sqlntsv/htm/ns_gettingstarted_4mn9.asp

I hope this answers your question!

- Colin Meek [MSFT]

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

Please do not send e-mail directly to this alias. This alias is for
newsgroup purposes only.
--

[quoted text, click to view]

Re: <NonHostedProvider> Joe Webb
2/4/2005 11:06:56 AM
Hey Tony -

An example of a non-hosted event provider would be another database
application that calls the Event Collection Stored Procedures directly
such as a web site, CRM package, or order entry system. NS just needs to
know the name in advanced.

Non-hosted event providers are run or "triggered" by their own
mechanisms, whether scheduled or event-driven.


HTH...
Joe Webb
SQL Server MVP

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



[quoted text, click to view]
Re: <NonHostedProvider> Shyam Pather [MSFT]
2/4/2005 3:11:08 PM
Anthony,
An event provider is some entity that submits events. The definition of a
hosted event provider is one that runs in the NS service process i.e. an
event provider that is "hosted" by the NS service. A non-hosted provider is
one that runs in any other process (such as query analyzer if you're
submitting events manually, or IIS if you're using a web-based event
provider). That's actually the only distinguishing characteristic: the
process in which the event provider runs.

For hosted providers, you need to include configuration information in your
ADF that tells the NS service how to load the provider. You typically supply
a provider class name, which can be the name of one of the built-in hosted
providers, or the class name of a custom hosted provider you have
implemented. Implementing a custom hosted event provider involves writing a
..NET class that implements the IEventProvider or IScheduledEventProvider
interfaces. If you're using a custom hosted event provider, you need to
supply an assembly name, and any required arguments as well.

Non-hosted providers are external to the NS service, therefore the NS
service does not need to know much about them. In fact, the only reason you
provide a name is for tracking purposes (auditing which events were
submitted by which provider later on). The NS service does not need to know
how to load or configure them because it does not host these providers. By
supporting non-hosted providers, NS allows you to submit events from any
application. Non-hosted providers are always custom, in the sense that
they're always provided by you: NS does not provide any built-in non-hosted
event providers.

So really, the following distinctions exist:

Hosted (runs in the NS service) vs. Non-hosted (runs outside the NS service)
Custom (code provided by you) vs. Built-in (provided by NS)
Scheduled (invoked on a fixed schedule) vs. Continous (invoked once and
expected to run continuously)

The scheduled vs. continuous distinction is really only valid when talking
about hosted event providers.

Sorry this confusing - there are lots of dimensions here, to allow for
maximum flexibility. I'll pass your feedback on to our doc writer and see if
we can clarify this in the next release.

If you need more info, my book on SQL-NS
(http://www.amazon.com/exec/obidos/tg/detail/-/0672326647/) provides
detailed info on all aspects of event providers in Chapter 8.

Hope this helps.
-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: <NonHostedProvider> Anthony Small
2/4/2005 3:48:22 PM
Hi Colin,
Thanks for your response.
It seems to me that an NS application needs a <nonhostedprovider> to be
specified to be able to push events (manually) into SQLNS rather than having
SQLNS pull them into the system with a hosted provider. Is that a fair
comment?

The docm gives information about the custom aspect of NonHostedProviders but
little that I could find about simply using a <NonHostedProvider> without
other information? In other words there appears to be little about when and
how a nonhostedprovider might be useful in an application. The docm refers
to NonHostedProviders being custom but they really are custom (where you
HAVE to specify custom information) and another type (non-custom?) for which
no information has to be provided!
That is what I regard as an ESSENTIAL piece of information that should be
elucidated in a central place under "SQL Server Notification Application
Essential Information" or "How to suceed in Building SQL Notification
Services Applications" in your SQL2005 docm along with other stuff that I
think is absent.<g>

In answer to you question, yes, your response answers my question but I wish
that the docm was so easily forthcoming. I spent ages hunting around to find
an example or information before posting. So, in summary, there is no link
with the nonhostedprovider node and anything else other in the config or adf
file other than the calling application specifying the provider name and
then submitting the event.

Thanks again for your time.

Tony S.
[quoted text, click to view]

Re: <NonHostedProvider> Anthony Small
2/4/2005 4:46:57 PM
Hey Joe,
Thanks for the good examples!

Tony S.
ps waiting to take delivery of your book!

[quoted text, click to view]
Re: <NonHostedProvider> Anthony Small
2/5/2005 10:20:22 AM
Hi Shyam,
I have already ordered your book and I am awaiting delivery.

I think the difference between NonHosted (with className etc provided) vs
NonHosted (with only the ProviderName specified) is also a valid
distinction.
And that fact that I can simply specify a NonHostedProvider node with only
name but link specified to any particular event class is also interesting.
What if my application has several EventClasses with several
NonHostedProviders how does SQLNS correlate calls on a particular provider
to a particular event class? This really was my initial problem. I could not
see how merely specifying a providername could cause SQLNS to map events
supplied to that provider to a particular eventclass.... and BOL wasn't
helpful!

TIA

Tony S.

I think you take my point which is that
[quoted text, click to view]
Re: <NonHostedProvider> Joe Webb
2/7/2005 8:09:08 AM
THANKS!!! :)

Hope you find it useful!!


HTH...
Joe Webb
SQL Server MVP

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




[quoted text, click to view]
Re: <NonHostedProvider> Anthony Small
2/7/2005 6:58:20 PM
I feel sure I will.

Tony S.
[quoted text, click to view]

Re: <NonHostedProvider> Shyam Pather [MSFT]
2/10/2005 2:41:46 PM
Hi Anthony,
Actually, the only valid configuration for <NonHostedProvider> is with just
the provide name specified. NS does not recognize, or allow you to specify,
a class name etc for <NonHostedProvider>.

There is no correlation between event providers and event classes: any event
provider may submit events of any event class. The event class name is
specified at the time of event submission, using one of the 3 event
submission APIs (the managed event object API, the SQL stored procedures, or
the XML bulkloader).

-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: <NonHostedProvider> Anthony Small
2/10/2005 11:40:00 PM
Oh, I see! There is no relationship between the two.
I can specify a particular nonhostedprovider and specify any event class.
I had completely missed that.
Thanks
Tony S.
[quoted text, click to view]
AddThis Social Bookmark Button