Process Deployment in Clustered Embedded Camunda

Hello.

Let me start by explaining my enviroment: I have multiple JBoss instances running in standalone mode serving a web application packaged as a war file. The instances are invoked using a hardware load balancer according to a certain algorithm. The exact same version of my war file is deployed to each instance. All the instances share a common database.

What I want to do is to use the embedded deployment way of Camunda and, as the name says, embeded it into my application as a library.

Now, I am ok that each instance is not aware of each other. My hardware load balance can take care of that.

My problem is, how do I deploy the process in this scenario? I have a .bpmn file inside my war and I thought about adding a Servlet listener that will deploy the process using the API when the servlet context starts. But, since one context will be started on each cluster instance, will it try to deploy the process multiple times to the database?

Is there any alternative to this approach?

Thanks a lot in advance for your help.

Hi @felipefraga,

I think you’re going in the right direction. When making a deployment, you can use the method DeploymentBuilder#enableDuplicateFiltering to avoid multiple deployments. Then, your code will be similar to how a process application deployment works on a shared engine.

Cheers,
Thorben

1 Like

Hi @thorben

Coded your suggestion and did some tests. It seems to work as expected. I was concerned about concurrency during deployment, but taking a look at the deploy command (DeployCmd.java) source, it uses a pessimistic lock to deploy the process since 2014. So, looks good.

Thanks a lot for the help.