Activity Running multiple instances and it's impact

64 Views Asked by At

In our project we are using Activiti for workflow, the backend as well as front end is hosted on kubernetes, the challenge is if I have to scale the services what would happen to triggers and time based cron jobs will they be triggered multiple times, if so how can i achieve distributed locks is it something we need to handle or activiti does by itself

Implementation solution or suggestions

2

There are 2 best solutions below

0
boredabdel On

That's not something k8s or GKE can do for you. If Activiti is responsible for running the workflows and you want to avoid running the same workflow twice. That's something that needs to be done on Activiti.

Maybe look into consul or zookeeper to implement the distributed locking mechanism ?

0
Greg Harley On

Activiti (talking Activiti 6 here) will automatically handle scaling inside a k8 cluster as long as all engines are connected to the same database. Activiti itself is stateless, the state is maintaned in the database and jobs are locked on acquisition so another executor cannot/will not pick it up. As for "cron" jobs, I am assuming you mean "timer start events", the same applies, these are just jobs that are picked up by a job executor (the timer job executor in this case).