仅在一个WebLogic群集节点上运行@Scheduled任务? [英] Run @Scheduled task only on one WebLogic cluster node?

查看:152
本文介绍了仅在一个WebLogic群集节点上运行@Scheduled任务?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们正在运行一个Spring 3.0.x Web应用程序(.war),它在群集的WebLogic 10.3.4环境中每夜都有@Scheduled作业.但是,由于将应用程序部署到每个节点(使用AdminServer的Web控制台中的部署向导),该作业每天晚上在每个节点上启动,因此可以同时运行多次.

We are running a Spring 3.0.x web application (.war) with a nightly @Scheduled job in a clustered WebLogic 10.3.4 environment. However, as the application is deployed to each node (using the deployment wizard in the AdminServer's web console), the job is started on each node every night thus running multiple times concurrently.

我们如何防止这种情况发生?

我知道像Quartz这样的库允许通过数据库锁定表来在集群环境中协调作业,甚至我自己也可以实现这样的事情.但是由于这似乎是一个相当普遍的情况,所以我想知道Spring是否还没有一个选项,可以轻松地解决这个问题,而不必向我的项目中添加新的库或手动进行解决.

I know that libraries like Quartz allow coordinating jobs inside clustered environment by means of a database lock table or I could even implement something like this myself. But since this seems to be a fairly common scenario I wonder if Spring does not already come with an option how to easily circumvent this problem without having to add new libraries to my project or putting in manual workarounds.

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