Lesson 8: Altering Application Execution Settings
In this lesson you will configure application execution settings in the application definition file (ADF) and then update the instance of Notification Services to apply the changes to the application database.
Application Execution Settings
Notification Services provides several application execution settings for tuning your application. These settings control how frequently data is processed, how far the generator is allowed to fall behind the real-time clock, how events are processed, how much data can be received and sent, how distribution data is logged, and how frequently old data is removed from the database.
For more information about these settings, see Specifying Application Execution Settings.
Application Execution Settings for the Weather Application
For this application, you will configure three application execution settings: the generator quantum, distributor logging, and the data removal interval. You should configure these settings in every application.
- You will set the quantum duration to 15 seconds. This is PT15S in the XML duration format. This configures the generator to fire subscription rules every 15 seconds. In your applications, this quantum duration might be longer. For more information, see Specifying the Generator Quantum Duration.
- You will turn off distributor logging to minimize the data logged to the application database per notification. You may want to enable distributor logging during application development, but you should turn off all or most distributor logging when you deploy your applications. For more information, see Configuring Distributor Logging.
- You will specify a data removal interval so that older event, notification, and distribution data is regularly removed from the application database. The vacuuming schedule specifies that data older than one day can be deleted from the database, and that the data removal process runs at 23:00:00 UTC. For more information, see Configuring Data Removal.
Add the Application Execution Settings Code to the ADF
The XML in this section configures application execution settings as described earlier. Examine the XML and then follow the instructions to copy the XML to the ADF.
To add the application execution settings code to the ADF
Click Copy Code to copy the code to the Windows Clipboard.
<!-- ApplicationExecutionSettings --> <ApplicationExecutionSettings> <QuantumDuration>PT15S</QuantumDuration> <DistributorLogging> <LogBeforeDeliveryAttempts>false</LogBeforeDeliveryAttempts> <LogStatusInfo>false</LogStatusInfo> <LogNotificationText>false</LogNotificationText> </DistributorLogging> <Vacuum> <RetentionAge>P1D</RetentionAge> <VacuumSchedule> <Schedule> <StartTime>23:00:00</StartTime> <Duration>P0DT02H00M00S</Duration> </Schedule> </VacuumSchedule> </Vacuum> </ApplicationExecutionSettings>
In Solution Explorer, open WeatherADF.xml.
Replace the following comment with the code you just copied.
<!-- Replace with ApplicationExecutionSettings XML -->
On the File menu, click Save WeatherADF.xml.
Update the Instance of Notification Services
After you modify the ADF, update the instance of Notification Services to modify the application execution settings in the application database.
To update the instance of Notification Services
In Object Explorer, expand Notification Services.
Right-click Tutorial, point to Tasks, and then select Update.
In the Update Instance dialog box, click Browse, locate the TutorialICF.xml file, and then click Open.
In the Parameters pane, enter values for the parameters. Use the same values you used to create the instance.
Click OK.
Review the Notification Services - Update Summary dialog box, and then click Update.
When the update is completed, click Close.
You can now close WeatherADF.xml.
Next Lesson
Lesson 9: Registering, Enabling, and Starting the Instance
See Also
Concepts
Notification Services Tutorial
Other Resources
Specifying Application Execution Settings
Building Notification Solutions
Introducing SQL Server Notification Services