Multi-ProcessEngine-Configuration within one SpringBootApp

So far I was using the default process engine and configured it via YML-Configuration and publishing ProcessEnginePlugin-Beans. While this was sufficient in the past, requirements changed and multiple process engines with possilbly different configuration & data base schemas have become neccessary. I already found an example on the github page: camunda-bpm-examples/multi-tenancy/schema-isolation at master · camunda/camunda-bpm-examples · GitHub. Sadly, this example only describes multi-engine-configuration via a process.xml. Also, scimming the source code I had the impression that the spring part is pretty much build around the idea of having a single engine with possibly different tenants.

So my question is: What would be the best way to implement a multi-engine setup within a single spring boot application. Migrating to a processes.xml-configuration is not a possibility in my case.We bundled multiple applications that dynamically register at a root spring boot application. In short this means, I can’t write a single processes.xml not knowing which applications might be active. I found a possibility to configure multiple processes.xml’s, but this is only available via the ProcessApplication-Annotation, where I would need to put paths statically which again is not possible because the information is spread over multiple projects and not known ahead of runtime.

I’m excited to have any feedback & ideas on my problem!

Hi @Adagatiya,

the Spring-Boot-Starter didn’t support multiple embedded engines.

You can start several instances of your Spring Boot App to get the same effect.

Hope this helps, Ingo

Thank you for your response @Ingo_Richtsmeier !

So, as expected, there is no out-of-the-box option for us to solve the issue using the spring boot starter. I had a tiny glimmer of hope because documentation contained an example for scope dependant dependency injection with multiple engines.
As you already pointed out, we could start several instances of our “root spring boot application” and restrict that applications that use Camunda would need to run on separate instances. Any other approach would be probably lead to high efforts.

Sidenote: Documentation on multi-tenancy including schema isolation was very well-written and contained much information while providing couple examples for easy hands-on. I’m just slightly disappointed I was not able to port it to my usecase.

Hi @Adagatiya,

I heard in a discussion from the original maintainers of the camunda-spring-boot-starter, that the multiple-engine approach
A.) makes the solution much more complicated, especially when it comes to datasource setup
B.) contradicts somehow to the configuration concepts of spring boot giving everything a reasonable default value

Hope this helps, Ingo

Thank you again for your insights @Ingo_Richtsmeier !

To sum up your answer, the spring boot starter currently does not support it and there is no easy way to integrate that concept. If we would want to use multiple engines in our app, we would need to move away from spring boot starter, possibly building process engines on app startup manually or use configuration via a processes.xml.

We will evaluate how important it is to us to support having both camunda-based apps registered to the same “root spring boot application” at the same time.

Kind regards
Adagatiya