简体   繁体   中英

Difference between Quartz Thread Pool and Task Executor

I'm working in Spring-quartz batch. I'm trying to implement Multi-threading for the Batch application.

I come across 2 possible way of multi threading,

  1. Use Quartz Thread pool
  2. Use Task Executors.

I used Quartz thread pool and it is working fine but was wondering what the advantage i will get if i also implement task Executor.

I'm doing all this as xml configuration.

Please suggest me which should be used and what is the benefit of one over the other.

Thanks

I would choose task executors if all you need is to keep N workers picking pieces of work from the common queue. The advantage is that you do not need any external libraries for this. Quartz thread pool was created before Java 5 - that is why it exists.

Executor is good enough for running concurrent tasks within a JVM. But if you want to distribute tasks across multiple JVMs in a clustered environment, then you should explore Quartz using the JDBC Store. Quartz is more of a scheduling framework where you can setup jobs to run on a periodic basis. But I have also used it heavily for concurrent programming.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM