CrystalQuartz实现Quartz的window服务的远程管理

一、 建一个空的ASP.NET WebSite,利用NuGet安装CrystalQuartz.Remote 包

咱们能够看到,配置文件中多了以下节点:git

<crystalQuartz> <provider> <add property="Type" value="CrystalQuartz.Core.SchedulerProviders.RemoteSchedulerProvider, CrystalQuartz.Core" /> <!-- Edit scheduler host value below =================================== --> <add property="SchedulerHost" value="tcp://localhost:555/QuartzScheduler" /> <!-- =================================== --> </provider> </crystalQuartz>

handlers节点中多了以下配置:github

<add name="CrystalQuartzPanel" verb="*" path="CrystalQuartzPanel.axd" type="CrystalQuartz.Web.PagesHandler, CrystalQuartz.Web" />

能够看到,将CrystalQuartzPanel.axd的请求映射到了CrystalQuartz.Web.PagesHandler中web

二、window服务安装CrystalQuartz

实际上quartz.config中也有以下配置(去掉#注释):windows

# export this server to remoting context quartz.scheduler.exporter.type = Quartz.Simpl.RemotingSchedulerExporter, Quartz quartz.scheduler.exporter.port = 555 quartz.scheduler.exporter.bindName = QuartzScheduler quartz.scheduler.exporter.channelType = tcp quartz.scheduler.exporter.channelName = httpQuartz

这样两个程序就能够通讯了。浏览器

三、新建的网站部署到IIS,开启WindowsService,而后在浏览器里面浏览新的站点,在默认的端口后面直接输入:/CrystalQuartzPanel.axd 就看访问了

这个页面会将quartz_jobs.xml中的触发器都加载出来,能够从新暂停、删除、当即执行,还能够新建触发器,其它复杂功能尚未仔细研究tcp

CrystalQuartz GitHub 地址:https://github.com/guryanovev/CrystalQuartzide

相关文章
相关标签/搜索