用于每小时发送状态电子邮件的任何现有项目/软件
检查系统状态并通知用户的经典需求。具体来说,我将每隔 x 时间访问数据库,获取一些数据,然后根据结果发送电子邮件通知。哎呀,该服务甚至可能不会发送电子邮件,而是在数据库中创建通知记录。
似乎通过 IOC 和配置,可以有一个通用的 Windows 服务以简单的方式管理所有这些以及指标和管理。
过去我通过以下方式完成电子邮件通知: 1) 将脚本作为 cron(Windows 上的 at)作业运行 2) 将自定义可执行文件作为 cron/at 作业运行 3)使用SQLServer的DatabaseMail之类的东西。 4) 始终运行监视事物的自定义 NT 服务。
有没有开源项目可以管理这个?这是我在各种平台上编写过很多次的代码类型,但现在不想花几天时间来做。
到目前为止我唯一发现的是 Quartz.Net
谢谢
Classic requirement of checking system state and notifying users. Specifically, I'll be hitting the database every x-amount of time, getting some data, then sending out email notifications based on the results. Heck, this service might not even send out an email, but create a notification record in the database.
Seems like with IOC and configuration there could be a generic windows service that manages all this, along with metrics and management, in a simple manner.
In the past I've done email notifications by:
1) Running scripts as cron (at on Windows) jobs
2) running custom executables as cron/at jobs
3) using something like SQLServer's DatabaseMail.
4) Custom NT Services that run all the time monitoring things.
Is there any open source projects that manages this? It's the type of code I've written many, many times in various platforms, but don't want to spend the few days doing it now.
The only thing I found so far was Quartz.Net
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我只是创建一个 Windows 服务并使用响应式扩展来安排任务。如果您不需要 cron 提供的灵活性,那么这很好用。这是一个抽象的每小时任务运行程序。 (使用 log4net)
然后在启动方法中,您可以解析所有
IWantToRunAtStartup
实例并对其调用Run()
。I just create a Windows service and use the Reactive Extensions to schedule tasks. If you don't need as much flexibility as cron offers, this works fine. Here's an abstract hourly task runner. (uses log4net)
Then in your start up method you can just resolve all
IWantToRunAtStartup
instances and callRun()
on them.