Dynamic manage multi-tenant Process engine in combination with Spring Boot?


#1

How should I configure the Spring boot part with multi tenancy (MT) in Camunda?

Our setup:
We have our own ProcessEngine Spring Factory that will create several underlying Camunda ProcessEngines (with own db) during startup, bases on the received tenant configuration. We use “RuntimeContainerDelegate.INSTANCE.get().registerProcessEngine” to register the process engines.

However, the camunda class SpringBootProcessApplication contains a default process engine, which is set to the first created process engine through the above call, and also registered this in the afterPropertieSet() method, that results in an Exception as their is already a ProcessEngine registered with the same name. That exception is easy to solve by overriding the method, however, I am wandering what the correct approach is concerning the (spring) configuration when using the above dynamic approach, that is: adding and removing your own process engines during runtime.

I read another post about this and this approach: LINK, but it doesn’t use Spring boot.
I am also seeing that a lof of beans are started by the Camunda Sprint boot config. What should I use or disable when using the above approach?

I think I should override the SpringBootProcessApplication and override the afterPropertiesSet and destroy() method to deal with multiple process engines, but is that enough? What do to more? And should I have som default process engine that I read about in other posts?

Please some advice?


#2

multi tenant deployments can be achieved via processes.xml. But you will still have the default engine responsible for running all tenants.
Multiple engines was never considered for the starter, the assumption was that one would rather run multiple applications for this use case (following the idea of micro services/engines).
But since I got the request quite often in the past, it might become a feature worth supporting, could you file an issue in Jira?


#3

multi tenant deployments can be achieved via processes.xml.

That is not an option for us, as we retrieve the tenant configuration during startup from an external service.

But you will still have the default engine responsible for running all tenants.

What do you mean by this? I mean: I create my process engines my self, do I still have a default? And what is that default (the first one created)?

Multiple engines was never considered for the starter

Ok, I will put a request in Jira, but in the mean time, how can I get it to work with the starter?

Thanks for the quick reply.


#4

@jangalinski What is the benefit of running multiple engines in the single application vs running multiple containers, each with their own app/engine instance?