I'm looking for proper "Multiple Engines" example configuration

Hello,
I have 2 separate engines(apps) as SpringBoot servers: camunda-bpm-spring-boot-starter-rest

  • Camunda BPM: (v7.8.0)
  • Camunda BPM Spring Boot Starter: (v2.3.0)

Now I need one common web console to administrate those engines instances (view tasks/processes, etc.)
Like it is shown in documentation:

I tried with “configuration file” as is shown in documentation:

But it doesn’t work (no menu where will be engines to select one of them)
Where I should put file environment-config.json (I downloaded and started with camunda-bpm-ee-tomcat-7.8.6-ee.zip package).

It is possible to configure SpringBoot server: camunda-bpm-spring-boot-starter-webapp that will be access to multiple engines? Where put information about those external engines - in file application.yaml?

Regards,
Maja

1 Like

I found solution by try and error method (for tomcat configuration):
In file bpm-platform.xml (located in tomcat conf folder) I set:

    <process-engine name="myEngine1">
      <datasource>java:jdbc/ProcessEngine1</datasource>
      …
    </process-engine>
    <process-engine name="myEngine2">
      <datasource>java:jdbc/ProcessEngine2</datasource>
      …
    </process-engine>

In file server.xml (located in tomcat conf folder) I defined Data Sources:

  <Resource name="jdbc/ProcessEngine1" …>
  <Resource name="jdbc/ProcessEngine2" …>

And now I have one administration console for two process Engines.
Bye :slight_smile:

4 Likes

Thanks for sharing the solution.

For those of you working in WildFly, the following worked for me for Camunda 7.8.0-ee, WildFly 10.1.0, MySQL 5.7.25, and MySQL driver 8.0.15. Note that I am using two separate database servers, which increases the overall throughput. I’m sure there are ways to further optimize this.

You would need some mechanism, however, to redirect traffic to one engine or the other. In a typical process start URL, you would change the engine name element. Example:

Normal “default” Process Engine:

http://myhost.mydomain.com:8880/engine-rest/engine/default/process-definition/key/myProcess/start

Second Process Engine:

http://myhost.mydomain.com:8880/engine-rest/engine/engine_2/process-definition/key/myProcess/start

When I ran processes against both, records showed up in the different databases, but the GUI and other reporting would be accessed at a single point.

Following are configuration sections from the WildFly standalone.xml file. Adjust as needed.

Process Engines:

    <subsystem xmlns="urn:org.camunda.bpm.jboss:1.1">
        <process-engines>
            <process-engine name="default" default="true">
                <datasource>java:jboss/datasources/ProcessEngine</datasource>
                <history-level>full</history-level>
                <properties>
                    <property name="jobExecutorAcquisitionName">
                        default
                    </property>
                    <property name="isAutoSchemaUpdate">
                        false
                    </property>
                    <property name="authorizationEnabled">
                        true
                    </property>
                    <property name="jobExecutorDeploymentAware">
                        true
                    </property>
                    <property name="historyCleanupBatchWindowStartTime">
                        00:01
                    </property>
                </properties>
                <plugins>
                    <plugin>
                        <class>org.camunda.bpm.application.impl.event.ProcessApplicationEventListenerPlugin</class>
                    </plugin>
                    <plugin>
                        <class>org.camunda.spin.plugin.impl.SpinProcessEnginePlugin</class>
                    </plugin>
                    <plugin>
                        <class>org.camunda.connect.plugin.impl.ConnectProcessEnginePlugin</class>
                    </plugin>
                </plugins>
            </process-engine>
            <process-engine name="engine_2">
                <datasource>java:jboss/datasources/ProcessEngine_2</datasource>
                <history-level>full</history-level>
                <properties>
                    <property name="jobExecutorAcquisitionName">
                        engine_2
                    </property>
                    <property name="isAutoSchemaUpdate">
                        false
                    </property>
                    <property name="authorizationEnabled">
                        true
                    </property>
                    <property name="jobExecutorDeploymentAware">
                        true
                    </property>
                    <property name="historyCleanupBatchWindowStartTime">
                        00:01
                    </property>
                </properties>
                </properties>
                <plugins>
                    <plugin>
                        <class>org.camunda.bpm.application.impl.event.ProcessApplicationEventListenerPlugin</class>
                    </plugin>
                    <plugin>
                        <class>org.camunda.spin.plugin.impl.SpinProcessEnginePlugin</class>
                    </plugin>
                    <plugin>
                        <class>org.camunda.connect.plugin.impl.ConnectProcessEnginePlugin</class>
                    </plugin>
                </plugins>
            </process-engine>
        </process-engines>
        <job-executor>
            <core-threads>16</core-threads>
            <max-threads>320</max-threads>
            <queue-length>640</queue-length>
            <job-acquisitions>
                <job-acquisition name="default">
                    <properties>
                        <property name="lockTimeInMillis">
                            300000
                        </property>
                        <property name="waitTimeInMillis">
                            5000
                        </property>
                        <property name="maxJobsPerAcquisition">
                            36
                        </property>
                        <property name="backoffTimeInMillis">
                            90
                        </property>
                        <property name="maxBackoff">
                            450
                        </property>
                    </properties>
                </job-acquisition>
                <job-acquisition name="engine_2">
                    <properties>
                        <property name="lockTimeInMillis">
                            300000
                        </property>
                        <property name="waitTimeInMillis">
                            5000
                        </property>
                        <property name="maxJobsPerAcquisition">
                            36
                        </property>
                        <property name="backoffTimeInMillis">
                            90
                        </property>
                        <property name="maxBackoff">
                            450
                        </property>
                    </properties>
                </job-acquisition>
            </job-acquisitions>
        </job-executor>
    </subsystem>

Data Sources

    <subsystem xmlns="urn:jboss:domain:datasources:4.0">
        <datasources>
            <datasource jta="true" jndi-name="java:jboss/datasources/ProcessEngine" pool-name="ProcessEngine" enabled="true" use-java-context="true" use-ccm="true" statistics-enabled="true">
                <connection-url>jdbc:mysql://mysql_S_1.domain.com:3306/camunda_db?autoReconnectForPools=true</connection-url>
                <driver>mysql</driver>
                <transaction-isolation>TRANSACTION_READ_COMMITTED</transaction-isolation>
                <pool>
                    <min-pool-size>100</min-pool-size>
                    <initial-pool-size>100</initial-pool-size>
                    <max-pool-size>500</max-pool-size>
                </pool>
                <security>
                    <user-name>camunda</user-name>
                    <password>campass</password>
                </security>
                <validation>
                    <valid-connection-checker class-name="org.jboss.jca.adapters.jdbc.extensions.mysql.MySQLValidConnectionChecker"/>
                    <background-validation>true</background-validation>
                    <background-validation-millis>2000</background-validation-millis>
                    <stale-connection-checker class-name="org.jboss.jca.adapters.jdbc.StaleConnectionChecker"/>
                    <exception-sorter class-name="org.jboss.jca.adapters.jdbc.extensions.mysql.MySQLExceptionSorter"/>
                </validation>
                <timeout>
                    <set-tx-query-timeout>false</set-tx-query-timeout>
                    <blocking-timeout-millis>0</blocking-timeout-millis>
                    <idle-timeout-minutes>0</idle-timeout-minutes>
                    <query-timeout>0</query-timeout>
                    <use-try-lock>0</use-try-lock>
                    <allocation-retry>0</allocation-retry>
                    <allocation-retry-wait-millis>0</allocation-retry-wait-millis>
                </timeout>
                <statement>
                    <share-prepared-statements>false</share-prepared-statements>
                </statement>
            </datasource>
            <datasource jta="true" jndi-name="java:jboss/datasources/ProcessEngine_2" pool-name="ProcessEngine_2" enabled="true" use-java-context="true" use-ccm="true" statistics-enabled="true">
                <connection-url>jdbc:mysql://mysql_S_2:3306/camunda_db&amp;autoReconnectForPools=true</connection-url>
                <driver>mysql</driver>
                <transaction-isolation>TRANSACTION_READ_COMMITTED</transaction-isolation>
                <pool>
                    <min-pool-size>100</min-pool-size>
                    <initial-pool-size>100</initial-pool-size>
                    <max-pool-size>500</max-pool-size>
                </pool>
                <security>
                    <user-name>camunda</user-name>
                    <password>campass</password>
                </security>
                <validation>
                    <valid-connection-checker class-name="org.jboss.jca.adapters.jdbc.extensions.mysql.MySQLValidConnectionChecker"/>
                    <background-validation>true</background-validation>
                    <background-validation-millis>2000</background-validation-millis>
                    <stale-connection-checker class-name="org.jboss.jca.adapters.jdbc.StaleConnectionChecker"/>
                    <exception-sorter class-name="org.jboss.jca.adapters.jdbc.extensions.mysql.MySQLExceptionSorter"/>
                </validation>
                <timeout>
                    <set-tx-query-timeout>false</set-tx-query-timeout>
                    <blocking-timeout-millis>0</blocking-timeout-millis>
                    <idle-timeout-minutes>0</idle-timeout-minutes>
                    <query-timeout>0</query-timeout>
                    <use-try-lock>0</use-try-lock>
                    <allocation-retry>0</allocation-retry>
                    <allocation-retry-wait-millis>0</allocation-retry-wait-millis>
                </timeout>
                <statement>
                    <share-prepared-statements>false</share-prepared-statements>
                </statement>
            </datasource>
            <drivers>
                <driver name="mysql" module="com.mysql">
                    <driver-class>com.mysql.cj.jdbc.Driver</driver-class>
                </driver>
            </drivers>
        </datasources>
1 Like

Is a configuration possible, to use custom ports for the processEngines ?
Start process of ProcessEngine1 at localhost:8080/engine-rest/…
Start process of ProcessEngine2 at localhost:8081/engine-rest/…

solved my issue: