Multiple Camunda Service On Same Database

Is there any way we can deploy multiple camunda service on a single DB instance?

I was trying to do the same but one camunda service is interfering in the execution of another camunda service. For eg: Let’s say we have two Camunda Service CS-A and CS-B pointing to same database. CS-A have Workflow1.bpmn and an external service task on a topic(say ExternalService) for calling a downstream service and CS-B have Workflow2.bpmn and a java delegate service(say CallDownStreamService.java) task for calling it’s downstream services. But when I’m trying to open an instance on CS-B and control flow reaches it’s java delegate, CS-A is somehow taking control over that open instance and searching for the java delegate inside it’s jar package and throwing an error unable to load class(CallDownStreamService.java) which is fine because CS-A don’t have that java delegate class in it’s jar packaging.

So my question is why and how CS-A is interfering by taking control of an instance which is supposed to be governed by CS-B or have been opened by any other camunda service? Is there any way we can segregate camunda instances on the basis of which application has opened an instance and that application only can have control over that open instance?

Thanks for any kind of suggestion or solution you can provide.

Hi,
do you have deploymentAware set up?
A thread that might be helpful: Scaling Heterogeneous Cluster With Deployment Aware Job Executor
Docs: Process Engine Configuration | docs.camunda.org

Hi Eileen,

I’m not aware about deploymentAware set up but I’ve gone through the references that you have shared, looks like the deploymentAware setup has worked for some people. I’ll try and let you know if it works in my use case.

Thanks for your quick response :blush:

Hi eileen,

I’m sharing the configuration I’ve done in my processes.xml file, I’m still getting the same error and I’ve also observed interference of CS-A process engine on CS-B running instances and due to this lot’s of exception log is getting printed in CS-A due to missing java delegate inside it’s package. Can you please tell me is there any thing missing in this configuration files.

CS-A

<process-application
  xmlns="http://www.camunda.org/schema/1.0/ProcessApplication"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

  <process-archive name="workflow-service">
    <process-engine>default</process-engine>
    <properties>
      <property name="isDeployChangedOnly">true</property>
      <property name="jobExecutorDeploymentAware">true</property>
      <property name="deploymentTenantId">CS-A</property>
    </properties>
  </process-archive>

</process-application>

CS-B

<process-application
  xmlns="http://www.camunda.org/schema/1.0/ProcessApplication"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

  <process-archive name="workflow-service">
    <process-engine>default</process-engine>
    <properties>
      <property name="isDeployChangedOnly">true</property>
      <property name="jobExecutorDeploymentAware">true</property>
      <property name="deploymentTenantId">CS-B</property>
    </properties>
  </process-archive>

</process-application>

Thanks for your help!!

Hi,
I’m not sure whether deploymentTenantId is a valid property name, I have a different use case but in C7.15 I’m using sth like:
<process-archive name="workflow-service" tenantId="CS-A">
instead of doing it via property. Please let me know whether that worked.

Yes Eileen this is the correct way of providing tenant name to a camunda workflow, but the problem with this is if you’ll use same workflow with a tenant Id then it will create the same workflow with tenant id and new workflow instances will get confused that for which workflow we are referring to while calling startProcessInstanceByKey() method.

Answer to my problem is to use below property under properties file of each camunda service pointing to the same DB and I’ve also marked each java delegate as Asynchronous and exclusive in the bpmn file. No need to use tenant Id.

camunda.bpm.job-execution.deployment-aware=true

1 Like

Thanks for sharing the solution:)