Lathy
Lathy

Reputation: 887

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

Upvotes: 2

Views: 2406

Answers (2)

Nitin R
Nitin R

Reputation: 46

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.

Upvotes: 1

dzidzitop
dzidzitop

Reputation: 385

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.

Upvotes: 2

Related Questions