Java分布式作业监控
我使用 Quartz 定期创建一堆作业,并将这些作业发送到队列 (RabbitMQ),并由 Akka Actor 拾取并执行它们。缺少的一项是工作监控。如果一项工作失败了,我什至都不会注意到。
这些作业相当简单:它们只有 1-2 个参数,并且没有依赖关系。
有什么东西(库、最佳实践等)我可以利用(即使是 SQL 模式也是一个好的开始)?
PS:我已经考虑过 Spring-Batch,它似乎开销太大。
I'm using Quartz to regularly create a bunch of jobs that I sent to a queue (RabbitMQ) where they are picked up and executed by Akka actors. One piece that is missing is job monitoring. If one job fails, I don't even notice.
The jobs are fairly simple: they only have 1-2 parameters and there are no dependencies.
Is there anything (library, best practice etc.) I can leverage for this (even a SQL schema would be a good start)?
PS: I already considered Spring-Batch and it seems to be too much overhead.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我认为您会找到监视 JMS 的工具。典型的一种是与 JMS 供应商捆绑。 JMS 的一个有趣功能是它可以检测消息处理失败并将消息发送给另一个使用者。
假设您采用 JMS 监控路线,您需要:
- 使您的 Akka actor 同步,以便 JMS 消息将等待其响应,然后再继续失败或成功。
- 无法发送 JMS 消息的 Quartz 作业的日志失败。
另一种解决方案是完全同步并让 Quartz 消息管理日志记录(可能在基类或代理中),因此您只需读取日志文件即可进行监视。
据我了解,Akka Actor 监控尚未实现,但已在计划中。与此同时,您可以从这里开始:http://groups。 google.com/group/akka-user/browse_thread/thread/3818fb17bef95869
I think that you'll find tools to monitor JMS. Typical one is bundle with the JMS vendor. An interresting feature of JMS would be that it can detect message processing failure send the message to another consummer.
Assuming you go the JMS monitoring route you'll require to:
- make your Akka actor synchronous so the JMS message will wait for it to respond before proceding to failure or success.
- log failures for Quartz job that weren't able to send JMS message.
Another solution would be to be fully synchronous and let the Quartz message manage the loging (possibly in a base class or a proxy) so all you have to do for monitoring is reading the log file.
From my understanding Akka Actor monitoring is not here yet, but it is on the plans. In the meantime, you can have a start here: http://groups.google.com/group/akka-user/browse_thread/thread/3818fb17bef95869