Quartz.NET 调度程序应用程序域
我有一个 Web 应用程序,并设置了 Quartz 以在应用程序启动期间初始化调度程序。我的问题是 Quartz Scheduler 是否位于同一个应用程序域中,或者调度程序有自己的应用程序域?
我问这个问题的原因是因为在我的 Quartz 工作中,我需要使用 ConfigurationManager.GetSection["MySettings"] (在我的 web.config 中可用)检索一些配置数据,有时它会抱怨找不到配置。
我感到困惑的是,这种情况并没有发生在该工作的所有实例上,它是间歇性的。
以前有人遇到过这样的问题吗?
问候, 来福
I have a web application and have setup Quartz to initialize the scheuduler during application starts up. My question is does Quartz Scheduler live within the same appdomain or the scheduler has its own appdomain?
The reason I asked this is because in my Quartz job, I need to retrieve some configuration data using ConfigurationManager.GetSection["MySettings"] (which is available in my web.config) and sometimes it will complain that it can't find the configuration.
What I'm puzzled is this does not happen to all the instances of the job, it is intermitent.
Anyone faces this kind of issue before?
Regards,
lyf
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
最好的办法是使用 JobDataMap。
Best thing to do is to use JobDataMap.
它在同一个AppPool上运行,但在不同的线程上,我将我的Quartz.NET托管在单例WCF服务上,我唯一需要修改的是应用程序池IdleTimeout,如果你不改变你在存在您的应用程序池在空闲时将处于“待机”状态的风险,请更改为零(无超时),您可以手动或通过代码执行此操作,如这个 这篇文章
-问候
It runs on the same AppPool, but on different threads, I have my Quartz.NET hosted on a Singleton WCF Service, and the only thing that i had to modify was the Application Pool IdleTimeout, if you don't change that you are at risk that your application pool will be "Stand-by" when idle, change to Zero (no timeout), you can do it manually or by code as shown in this this post
-Regards