Using NT Service to host Quartz.NET Scheduler
I'm currently looking at using an NT Service to host a Quartz scheduler instance. (I'm using an NT Service instead of IIS as the scheduler cannot be guaranteed to be up as IIS will periodically perform recycling.)
The idea is that the service will start up, create a scheduler instance and refer to an XML file to start up a list of jobs (around 15).
Problem I need to be able to send me开发者_StackOverflow中文版ssages to the NT service to allow me to:
- Add new jobs
- Stop and Start Existing jobs
- Delete jobs
From what I've found, I'm pretty restricted here as I can only send an integer string to the service using the OnCustomCommand function of the service. Additionally, this will limit me to values of 128 --> 256. I hope to use values within this range to be interpreted by the service as scheduler commands (add, stop, start, and delete). Each command would refer to a specific file that held the parameters necessary for each job.
Before going any further, does this sound like a reasonable approach. Or, is it fraught with danger !!
Suggestions on this or a better approach are welcome.
Cheers,
I've decided to take the approach detailed at: http://www.codeproject.com/KB/WCF/WCF_windows_hosting.aspx
Basically, there will be an NT service which will host a WCF Library that contains all the functionality. So, I'm now not bound by the 128 --> 256 restrictions in the OnCustomCommand function!
精彩评论