Quarkus Extension Configuration

This section of the Camunda Quarkus extension documentation covers the configuration options for the process engine within a Quarkus application.

The documentation on the Camunda Quarkus Extension Configuration is intended for Quarkus application developers. It requires some knowledge on Quarkus CDI support, Quarkus configuration, as well as Camunda Process Engine Configuration properties.

Process Engine Configuration

An instance of the QuarkusProcessEngineConfiguration class configures the process engine in a Quarkus application. A QuarkusProcessEngineConfiguration instance provides the following defaults:

Property name Description Default value
jobExecutorActivate The job executor is activated. true
transactionsExternallyManaged Transactions are externally managed. true
databaseSchemaUpdate The Database Configuration section goes into more details on this propery and the resulting behavior. true
idGenerator An instance of StrongUuidGenerator is used. StrongUuidGenerator
jdbcUrl,
jdbcUsername,
jdbcPassword,
jdbcDriver
No JDBC configuration is present since a Quarkus datasource should be configured and used. null
history Camunda Cockpit works best with history level FULL. full

Quarkus allows to configure a Quarkus application via a MicroProfile Config source. You can read more about configuring a Quarkus application in the Quarkus configuration page. The Camunda Quarkus extension docs use the application.properties format in the examples, but you can use any supported Quarkus config source.

You can set any process engine configuration properties under the quarkus.camunda prefix. The Process Engine Configuration Properties page documents all the available properties. Please convert any property names from camelCase to the kebab-case format, like in the following example:

quarkus.camunda.cmmn-enabled=false
quarkus.camunda.dmn-enabled=false
quarkus.camunda.history=none
quarkus.camunda.initialize-telemetry=false

Programmatic Configuration

You can also configure the process engine programmatically, by providing a QuarkusProcessEngineConfiguration CDI bean.

@ApplicationScoped
public class MyCustomEngineConfig extends QuarkusProcessEngineConfiguration {
  public MyCustomEngineConfig() {
    // your custom configuration is done here
    setProcessEngineName("customEngine");
  }
}

Note that values of properties set in a QuarkusProcessEngineConfiguration instance have a lower ordinal than properties defined in a Quarkus config source.

In the above example, a QuarkusProcessEngineConfiguration CDI bean defines “customEngine” as the processEngineName. However, if you define the following in an application.properties file

quarkus.camunda.process-engine-name=quarkusEngine

then “quarkusEngine” will be used as the process engine name since Quarkus config sources have a higher ordinal than a QuarkusProcessEngineConfiguration CDI bean.

Job Executor Configuration

As with the process engine configuration properties above, you can set any job executor configuration properties under the quarkus.camunda.job-executor prefix. The Job Executor Configuration Properties page documents all the available properties. Convert any property names you intend to use from camelCase to the kebab-case format, like in the following example:

quarkus.camunda.job-executor.max-jobs-per-acquisition=5
quarkus.camunda.job-executor.lock-time-in-millis=500000
quarkus.camunda.job-executor.wait-time-in-millis=7000
quarkus.camunda.job-executor.max-wait=65000

Quarkus Extension Configuration

In addition to the general process engine and job executor configuration properties mentioned in the previous sections, the Camunda Quarkus extension provides some Quarkus-specific configuration properties. They can be set through a Quarkus config source, but not through the QuarkusProcessEngineConfiguration class. You can find all the Quarkus-specific properties in the following table:

Prefix Property name Description Default value
Data Source
quarkus.camunda .datasource Specifies which Quarkus datasource to use. If not defined, the primary Quarkus datasource will be used. For configuring a Quarkus Datasource, have a look on the Quarkus Datasource page. <default>
Job Executor
quarkus.camunda.job-executor.thread-pool .max-pool-size Sets the maximum number of threads that can be present in the thread pool. 10
.queue-size Sets the size of the queue which is used for holding tasks to be executed. 3

Persistence

The Engine Extension integrates with a JDBC Connection Pool and a Jakarta Transaction Manager provided by Quarkus. The latter allows you to integrate your business logic into database transactions of the Engine. Read more about it under JTA Transaction Integration.

Default Datasource

To get started quickly, the Engine Extension sets an embedded (local) on-disk H2 database as the primary/default Quarkus datasource, which you can override in your Quarkus application. You can find the default configuration properties on GitHub.

Choose from multiple datasources

When multiple datasources are available in your application, you can choose the one the Engine Extension should use by its name via the camunda.datasource configuration property. Consider the example configuration below:

quarkus.datasource.engine-datasource.db-kind=oracle
quarkus.datasource.engine-datasource.username=my-username
quarkus.datasource.engine-datasource.password=my-password
quarkus.datasource.engine-datasource.jdbc.url=jdbc:oracle:thin:@localhost:1521:ORCL

quarkus.camunda.datasource=engine-datasource

Using Quarkus Transaction Integration with CockroachDB

Quarkus allows its users to control transaction boundaries. This is documented on their Quarkus Transactions page. In case you use the Quarkus Transactions Integration with CockroachDB, please see the documentation section on external transaction management with CockroachDB to understand how to configure the Camunda process engine correctly.

Example

The following is an example of a Quarkus application.properties file that provides custom values for the process engine configuration, job executor and data source:

# process engine configuration
quarkus.camunda.cmmn-enabled=false
quarkus.camunda.dmn-enabled=false
quarkus.camunda.history=none
quarkus.camunda.initialize-telemetry=false

# job executor configuration
quarkus.camunda.job-executor.thread-pool.max-pool-size=12
quarkus.camunda.job-executor.thread-pool.queue-size=5
quarkus.camunda.job-executor.max-jobs-per-acquisition=5
quarkus.camunda.job-executor.lock-time-in-millis=500000
quarkus.camunda.job-executor.wait-time-in-millis=7000
quarkus.camunda.job-executor.max-wait=65000
quarkus.camunda.job-executor.backoff-time-in-millis=5

# custom data source configuration and selection
quarkus.datasource.my-datasource.db-kind=h2
quarkus.datasource.my-datasource.username=camunda
quarkus.datasource.my-datasource.password=camunda
quarkus.datasource.my-datasource.jdbc.url=jdbc:h2:mem:camunda;MVCC=TRUE;TRACE_LEVEL_FILE=0;DB_CLOSE_ON_EXIT=FALSE
quarkus.camunda.datasource=my-datasource

目录: