Skip to content

Commit

Permalink
Update to Camunda 7.22 (and remove telemetry because Camunda removed,…
Browse files Browse the repository at this point in the history
  • Loading branch information
tobiasschaefer committed Sep 16, 2024
1 parent c03d769 commit b2290cf
Show file tree
Hide file tree
Showing 9 changed files with 3 additions and 216 deletions.
27 changes: 2 additions & 25 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ _We're not aware of all installations of our Open Source project. However, we lo
* _discussing possible use cases with you,_
* _aligning the roadmap to your needs!_

📨 _Please activate [telemetry](#telemetry) and [contact](#contact) us!_
📨 _Please [contact](#contact) us!_

---

Expand Down Expand Up @@ -81,7 +81,6 @@ Micronaut Framework + Camunda = :heart:
* The job executor uses the Micronaut IO Executor's [thread pools](https://docs.micronaut.io/latest/guide/index.html#threadPools).
* The [process engine configuration](#custom-process-engine-configuration) and the [job executor configuration](#custom-job-executor-configuration) can be customized programmatically.
* A Camunda admin user is created if configured by [properties](#properties) and not present yet (including admin group and authorizations).
* Camunda's telemetry feature is automatically deactivated during test execution.

# 🚀Getting Started

Expand All @@ -96,7 +95,6 @@ This will take care of the following:
* The configuration file `application.yml`
* enables the Webapps and the REST-API
* is configured to create an admin user with credentials `admin`/`admin` with which you can login to http://localhost:8080/camunda
* enables telemetry
* Jetty will be pre-configured (instead of Netty) to support the Webapps and REST-API by default

All you need to do is save a process model in the resources, see the following section.
Expand Down Expand Up @@ -225,8 +223,6 @@ The properties can be set in kebab case (lowercase and hyphen separated) or came
Some of the most relevant properties are:
* database-schema-update (databaseSchemaUpdate)
* history
* initialize-telemetry (initializeTelemetry)
* telemetry-reporter-activate (telemetryReporterActivate)

Example:

Expand All @@ -237,21 +233,6 @@ camunda:
history: audit
```
### Telemetry
Please consider activating Camunda's telemetry feature so that the Micronaut Camunda Integration appears in Camunda's statistics.
When starting on a fresh database use:
```yaml
camunda:
generic-properties:
properties:
initialize-telemetry: true
```
If you missed the activation on an already active database or want to check/change the setting, go to the admin application and navigate to `System -> Telemetry Feature`. Locally, jump directly to the [Telemetry Feature](http://localhost:8080/camunda/app/admin/default/#/system?section=analytics-settings-general).

## Examples
Here are some example applications:
Expand Down Expand Up @@ -871,8 +852,6 @@ class HelloWorldProcessTest {
}
```

Note: the integration automatically disables the job executor and the process engine's telemetry feature during test execution. This is deduced from the "test" profile.

See also a test in our example application: [HelloWorldProcessTest](/micronaut-camunda-bpm-example/src/test/java/info/novatec/micronaut/camunda/bpm/example/HelloWorldProcessTest.java)

## Docker
Expand Down Expand Up @@ -938,9 +917,7 @@ If you create a Fat/Uber/Shadow JAR and run that you will see a warning:

This is because the repackaging of the jars implicitly removes the META-INF information.

Missing version information leads to
* Detailed telemetry cannot be sent to Camunda because the version is mandatory
* EE license cannot be configured
Without version information the EE license cannot be configured.

Instead, of creating a Fat/Uber/Shadow JAR, please see instructions on creating a [Docker](#docker) image and use the resulting image to run a Docker container.

Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ micronautLibraryPluginVersion=3.7.10
jettyVersion=9.4.49.v20220914
tomcatVersion=9.0.65
undertowVersion=2.2.18.Final
camundaVersion=7.21.0
camundaVersion=7.22.0-alpha5
# Latest Jersey, that implements JAX-RS 2.1 API: see https://eclipse-ee4j.github.io/jersey/download.html
jerseyVersion=2.39.1
# Prevent upload of maven-metadata.xml.sha256/sha512 files to oss.sonatype.org
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@ camunda:
admin-user:
id: admin
password: admin
generic-properties:
properties:
initialize-telemetry: true
webapps:
enabled: true
rest:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
</encoder>
</appender>

<logger name="org.camunda.bpm.engine.telemetry" level="DEBUG" />
<logger name="info.novatec.micronaut.camunda.bpm.feature" level="DEBUG" />

<root level="info">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,6 @@ public class MnProcessEngineConfiguration extends ProcessEngineConfigurationImpl

protected final MnJobExecutor jobExecutor;

protected final MnTelemetryRegistry telemetryRegistry;

protected final MnBeansResolverFactory beansResolverFactory;

protected final Environment environment;
Expand All @@ -90,7 +88,6 @@ public class MnProcessEngineConfiguration extends ProcessEngineConfigurationImpl
public MnProcessEngineConfiguration(SynchronousTransactionManager<Connection> transactionManager,
MnJobExecutor jobExecutor,
Configuration configuration,
MnTelemetryRegistry telemetryRegistry,
Environment environment,
CamundaVersion camundaVersion,
ApplicationContext applicationContext,
Expand All @@ -102,7 +99,6 @@ public MnProcessEngineConfiguration(SynchronousTransactionManager<Connection> tr
ProcessEngineConfigurationCustomizer processEngineConfigurationCustomizer) {
this.transactionManager = transactionManager;
this.jobExecutor = jobExecutor;
this.telemetryRegistry = telemetryRegistry;
this.beansResolverFactory = beansResolverFactory;
this.environment = environment;
this.camundaVersion = camundaVersion;
Expand All @@ -120,8 +116,6 @@ public MnProcessEngineConfiguration(SynchronousTransactionManager<Connection> tr

applyGenericProperties(configuration);

configureTelemetry();

registerProcessEnginePlugins();

processEngineConfigurationCustomizer.customize(this);
Expand Down Expand Up @@ -447,22 +441,6 @@ public List<CleanableHistoricCaseInstanceReportResult> executeList(CommandContex
};
}

/**
* Configure telemetry registry and always disable if the "test" profile is active, i.e. tests are being executed.
*/
protected void configureTelemetry() {
setTelemetryRegistry(telemetryRegistry);
if (environment.getActiveNames().contains(Environment.TEST)) {
setInitializeTelemetry(false);
setTelemetryReporterActivate(false);
} else if ( Boolean.TRUE.equals(isInitializeTelemetry()) && isTelemetryReporterActivate() && !camundaVersion.getVersion().isPresent() ) {
log.warn("Disabling TelemetryReporter because required information 'Camunda Version' is not available.");
setTelemetryReporterActivate(false);
} else {
setInitializeTelemetry(true);
}
}

/**
* Configure sensible defaults so that the user must not take care of it.
*/
Expand Down Expand Up @@ -501,12 +479,6 @@ protected Object resolveGenericPropertyValue(Object value, Class<?> type) {
}
}

public ProcessEngineConfigurationImpl setInitializeTelemetry(Boolean telemetryInitialized) {
// This method makes the Boolean telemetryInitialized a writable property.
// Otherwise applyGenericProperties cannot set the property.
return super.setInitializeTelemetry(telemetryInitialized);
}

protected void registerProcessEnginePlugins() {
log.info("Registering process engine plugins: {}", plugins);
setProcessEnginePlugins(plugins);
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -50,15 +50,13 @@ class MnProcessEngineConfigurationGenericPropertiesTest {
"camunda.generic-properties.properties.batch-job-priority" to "30",
"camunda.generic-properties.properties.default-number-of-retries" to "1",
"camunda.generic-properties.properties.dmn-enabled" to "false", //primitive data type: boolean
"camunda.generic-properties.properties.initialize-telemetry" to "false" //non primitive data type: Boolean
)
ApplicationContext.run(EmbeddedServer::class.java, properties).use { embeddedServer ->
val processEngineConfiguration = embeddedServer.applicationContext.getBean(MnProcessEngineConfiguration::class.java)
assertEquals("endTimeBased", processEngineConfiguration.historyCleanupStrategy)
assertEquals(30, processEngineConfiguration.batchJobPriority)
assertEquals(1, processEngineConfiguration.defaultNumberOfRetries)
assertEquals(false, processEngineConfiguration.isDmnEnabled)
assertEquals(false, processEngineConfiguration.isInitializeTelemetry)
}
}

Expand All @@ -71,14 +69,12 @@ class MnProcessEngineConfigurationGenericPropertiesTest {
"camunda.generic-properties.properties.batch-job-priority" to 30,
"camunda.generic-properties.properties.default-number-of-retries" to 1,
"camunda.generic-properties.properties.dmn-enabled" to false, //primitive data type: boolean
"camunda.generic-properties.properties.initialize-telemetry" to false //non primitive data type: Boolean
)
ApplicationContext.run(EmbeddedServer::class.java, properties).use { embeddedServer ->
val processEngineConfiguration = embeddedServer.applicationContext.getBean(MnProcessEngineConfiguration::class.java)
assertEquals(30, processEngineConfiguration.batchJobPriority)
assertEquals(1, processEngineConfiguration.defaultNumberOfRetries)
assertEquals(false, processEngineConfiguration.isDmnEnabled)
assertEquals(false, processEngineConfiguration.isInitializeTelemetry)
}
}

Expand Down

This file was deleted.

This file was deleted.

0 comments on commit b2290cf

Please sign in to comment.