Finding a Common Asynchronous Java Application / Library Implementation

I am looking for a generic asynchronous Java job execution platform that can handle Callableeither Runnables. It will be similar to java.util.concurrent.ExecutorService, (and possibly wrap ExecutorService), but it will also have the following functions:

  • The ability to save tasks in the database if the application is omitted during the maintenance of the task and can restart incomplete tasks. (I understand that my work may have to be implemented Serializable, which is in order.)

  • Work with the UUID so that the client can receive tokens and request the status of the job. (Under the hood, this information will be stored in the database.)

I started working on it myself, creating around ExecutorService, but I would prefer out of the box, open source, if it exists.

Something that could work within the framework of the Spring Framework would be ideal.

+5
source share
5 answers

You can use Quartz and create a specific Jobone that delegates to Runnableor Callable. Quartz Jobadds the ability to maintain some state between task calls. If desired, Quartz can store tasks and their status in a relational database and execute them on a scalable host cluster.

+3
source

Quartz.

Quartz - , J2EE J2SE - . , ; , Java EJB. Quartz , JTA .

+8
+2

- Terracotta, JVM . Terracotta Quartz, . , - , . .

+2

Alex, Terracotta , Terracotta.

Terracotta , .

POJO, DB txns, ORM .. - ( Terracotta , ).

MasterWorker , DistributedExecutorService, :

CompletionService executor = new DistributedCompletionService(new DistributedExecutorService("myTopologyName"));
executor.submit(new MyRunnable(), null);
...
Future f = executor.take();

Here's a link to the Quick Start Guide for implementing the master at Terracotta Forge .

What else - Terracotta doesn't require you to implement Serializable - although you can if you want :)

+2
source

All Articles