石英 +集群环境中使用 Spring 的 Workmanager
我们希望在集群 WebLogic 环境中执行作业。 Quartz(在集群模式下运行)用于保存作业,WorkManager 用于创建线程来运行作业。
然而,第一个 Quartz 实例立即锁定所有作业,这会阻止另一个节点/服务器并行执行。
所有作业的锁定都要归功于 LocalTaskExecutorThreadPool
public int blockForAvailableThreads() {
// The present implementation always returns 1, making Quartz (1.6)
// always schedule any tasks that it feels like scheduling.
// This could be made smarter for specific TaskExecutors,
// for example calling <code>getMaximumPoolSize() - getActiveCount()</code>
// on a <code>java.util.concurrent.ThreadPoolExecutor</code>.
return 1;
}
除了提供此类的另一个实现之外,是否有更好的方法使用 Weblogic WorkManager 在集群环境中并行执行作业?
We want to execute jobs on a clustered WebLogic environment. Quartz (running on clustered mode) is used to persist the jobs and WorkManager is used to create the threads to run the jobs.
However, the first Quartz instance immediately locks all the jobs and this prevents another node/server to do parallel execution.
This locking of all jobs is thanks to LocalTaskExecutorThreadPool
public int blockForAvailableThreads() {
// The present implementation always returns 1, making Quartz (1.6)
// always schedule any tasks that it feels like scheduling.
// This could be made smarter for specific TaskExecutors,
// for example calling <code>getMaximumPoolSize() - getActiveCount()</code>
// on a <code>java.util.concurrent.ThreadPoolExecutor</code>.
return 1;
}
Other than providing another implementation of this class, is there a better way to do parallel execution of jobs on a clustered environment using a Weblogic WorkManager?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您是否探索过将计时器定义为 WebLogic 端的集群单例服务?对于您使用的版本,步骤可能有所不同。
Have you explored the option of defining the timer as a clustered singleton service from the WebLogic side? The steps may be different for the version you're using.