cancel
Showing results for 
Search instead for 
Did you mean: 

Clustering support for Activiti

ruedesilva
Champ in-the-making
Champ in-the-making
Hi,

We have integrated Activiti into Weblogic Application Server but in most production systems there are clusters and multiple servers running on the same DB. This would be an issue with Job Executors as you'd only want one Job Executor to run. If a node goes down then Job Executor on another instance should start up automatically. An example is the Quartz Scheduler application that handles clustering well thru the DB.  Does Activiti have such a mechanism and if not is this in the road map as it is of high importance?

thanks,
Rue
4 REPLIES 4

meyerd
Champ on-the-rise
Champ on-the-rise
Hi Rue,

1) it is perfectly ok to have the jobexecutor running on every cluster node (that is how most people do it).

2) Activiti has no way of "telling" whether another node went "down" or something like that. To my knowledge there is also nothing like this on the roadmap.

ruedesilva
Champ in-the-making
Champ in-the-making
But it would not be ok to have it running on every node, for example of you have a job scheduled for x time and then you have multiple nodes trying to execute that job at the same time you'd have data corruption and concurrency issues. (i.e if you have a timer when fired runs some Java class to create a WF then suddenly it will create multiple WFs when only one should have been created)

thanks,
Rue

thilo_ginkel
Champ in-the-making
Champ in-the-making
But it would not be ok to have it running on every node, for example of you have a job scheduled for x time and then you have multiple nodes trying to execute that job at the same time you'd have data corruption and concurrency issues. (i.e if you have a timer when fired runs some Java class to create a WF then suddenly it will create multiple WFs when only one should have been created)
Activiti uses optimistic locking to ensure that no consistency issues occur. If you perform shared state modifications during those transactions that could fail you should probably participate in the transaction to ensure that your changes only survive if the transaction is committed successfully.

meyerd
Champ on-the-rise
Champ on-the-rise
Activiti locks jobs pessimistically in the job table to ensure that a job is only executed on a single cluster node.
See the JobExecutor for details.

It is perfectly ok to run the JobExecutor on each cluster node, the job will only be executed on a single node.