cancel
Showing results for 
Search instead for 
Did you mean: 

Cluster of Embedded Activti engines

bcampeau1
Champ in-the-making
Champ in-the-making
Hello,

I am working on a POC to show our client that Activiti can run in a cluster environnement.

I have a simple BPMN process that is started with a timer.  This process basically :

Task 1) poll a list of object (Country names)

Task 2) a multi instance sub process loop on the collection from task 1 and "visit" each country

Task 3) outside the multi instance sub-process, only display the list of visited Countries

Now FYI, this is an embedded Spring boot project.

So i start 2 different java process with the jar built.

Say : Server 1 and Server 2  (both access the same Activiti DB)

The behavior i see is :

First execution :
Server 1 will execute the process
Server 2 run but do nothing

Second execution:
Server 1 execute the process
Server 2 run but do nothing

…..

Now if i kill Server 1… i see that Server 2 will eventually wake up and execute the process.

So my understanding is of this internal activiti behavior is kinf of : hot / warm

So is it normal that Server 1 will always execute the process and Server 2 will just sit back and wait.

My Client is asking if its possible to be more like : hot /hot.  Meaning that randomly i should see Server 1 and Server 2 executing the process (not at the same obviously)

It this scenario possible?

Regards

1 REPLY 1

martin_grofcik
Confirmed Champ
Confirmed Champ
Hi Ben,

yes it is possible. I would say that in your case only one server locks the job and that's why the second one can not get the job to execute it. To present the functionality I would create several different jobs and let both job executors execute them.

Regards
Martin