Quartz vs Java EE 7调度程序 [英] Quartz vs Java EE 7 scheduler

查看:184
本文介绍了Quartz vs Java EE 7调度程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我是一名java EE开发人员,直到现在使用像Quartz这样的框架来安排任务。我可以看到Java EE 7具有ManagedScheduledExecutorService来安排单个或重复任务。由于我从未在实际项目中使用过这个新功能,我想知道当你有一个可移植的方法时,使用Quartz(或其他)是否仍有优势?

谢谢!


I'm a java EE developer which has used until now frameworks like Quartz to schedule tasks. I can see that Java EE 7 features a ManagedScheduledExecutorService to schedule single or repeating tasks. As I have never used in real projects this new features I wonder if there are still advantages of using Quartz (or others) when you have a portable way to do it ?
Thanks!

推荐答案

我相信在未来的项目中,确实没有必要使用第三个 - 党的图书馆。 Java EE 7充满了调度功能。除了新的 ManagedScheduledExecutorService 之外,还有 Schedule 注释用于单个和定期重复任务以及超时注释以编程方式创建计时器。 IMO新的托管预定服务更适合单个延迟任务或创建具有特定任务之间延迟的作业链。

I believe that in future projects, there's really no need to use third-party libraries. Java EE 7 is full of scheduling features. Besides the new ManagedScheduledExecutorService, there's already the Schedule annotation for single and periodic repeating tasks and the Timeout annotation to create timers programmatically. IMO the new managed scheduled service is better suited for single delayed tasks or to create a job chain with delays betweens specific tasks.

您可以找到有关Java EE定时服务的更多信息( 计划超时 Java EE 6 Java EE 7

You can find more about Java EE Timer Service (Schedule and Timeout) Java EE 6 or Java EE 7.

在旁注中,如果您尝试集群应用程序,则设置相对容易计划 - 类似于定时器全局运行,而不是每个节点运行一次 - 这是另一个加号。

On a side note, if you ever try clustering your application, it's relatively easy to setup Schedule-like timers to run globally, instead of once per node - which is another plus.

这篇关于Quartz vs Java EE 7调度程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆