SQLNS Configuration Files
To tie all these things and components together everything must be configured through a pair of XML-based configuration files: the Instance Configuration
file and the Application Definition
To host a SQLNS application you need an instance of SQLNS. An SQLNS instance can host one or more SQLNS applications. The instance also stores subscriber information, which can be shared among all SQLNS applications hosted on an instance. The Instance Configuration File registers each SQLNS application for that instance. Here's an example of an Instance Configuration file.
<?xml version="1.0" encoding="utf-8" ?>
Table 2 shows the most important XML elements used in this configuration file.
Table 2. The table shows a description of each main element in an Instance Configuration file.
||The name of this SQLNS instance.
||The name of the SQL Server that hosts the SQLNS instance database.
||Describes the several delivery channels supported by this SQLNS instance.
Within the <Applications>
section, you need an <Application>
section for each application hosted on this instance. Within each <Application>
element, you configure the XML elements shown in Table 3
Table 3. The table shows the XML elements needed within each <Application> element in the Instance Configuration file.
The Application Definition File
||Name of the SQLNS application hosted on this SQLNS instance.
||Base directory of the SQLNS application. Here are stored all application relevant information like the Application Definition File.
||Name and path to the Application Definition File that configures the SQLNS application.
The Application Definition File is more interesting. You use this file to configure the whole SQLNS application structure along with all necessary metadata. Listing 1
shows a minimal Application Definition File.
As you can see from Listing 1
, the sample SQLNS application
supports only one subscription, named StockPriceSubscription
. This subscription contains only one relevant bit informationthe StockSymbol
stored in a table column, which gives users of the front-end application the capability of entering the stock codes that they're interested in. SQLNS uses this configuration file to create all the tables required for the SQLNS application.. You'll see more about this feature later.
Through the section <NotificationClass>
you can define the structure of the notifications your application generates. That section's empty in Listing 1
, but you'll define it later. Currently the configuration file defines only that you're going to use the XsltFormatter to format the notifications. You use the Generator to generate the notifications and the Distributor to deliver those notifications to registered users. The <Generator>
sections define the computers on which those components are running, making it possible to distribute SQLNS application components over several physical computers for scalability.