我们有一个系统,将石英线程计数设置为 1,表示一次 1 个线程。这在我们的本地服务器上运行良好,并且一次启动 1 个线程(基于 Web ui 的链接触发),即使用户多次单击相同的触发器(触发器被放入队列中)。
但是,我们正在迁移到新的云服务器,并且多次单击时此触发器往往会单击多个线程(而不实际将最终线程放入队列中)。
我们使用 Tomcat6 和 Java 6。服务器上没有集群/负载平衡。任何想法/意见都会有很大帮助。
谢谢
We have a system where we set up the quartz thread count to 1, indicating 1 thread at a time. This works fine on our local servers and kicks of 1 thread at a time (trigger based on link from web ui),even though the user clicks the same trigger multiple times(the triggers are put in a queue).
However, we are migrating to a new cloud server and this trigger when clicked multiple times tends to click off multiple threads(without actually putting the eventual threads in queue).
We are using Tomcat6 and Java 6.There is no clustering/load balancing on the server. Any ideas/input would of great help.
Thank you
发布评论
评论(1)
我从未使用过 Quartz,但在 Java 中,您可以使用带有
ExecutorService
。有不同的执行器服务,因此您需要查看文档并了解哪些满足您的需求。 (也许尝试newFixedThreadPool(int)
)I've never used Quartz, but in Java you can use a thread pool with an
ExecutorService
. There are different executor services so you will need look at documentation and see which ones meets your needs. (Perhaps trynewFixedThreadPool(int)
)