Skip to content

Commit

Permalink
Feature/Spring Boot 3 (#882)
Browse files Browse the repository at this point in the history
* feat: upgrade to Spring Boot 3 (including Axon 4.8 and Camunda 7.20).

The changes are mostly due to the javax-->jakarta package rename, but there are some more things that needed to be changed for Spring Boot 3 to work. One of them is the upgrade to a newer version of flapdoodle embedded MongoDB with considerable changes to the API. Another one is that the hack for getting the spring.application.name property as a default value into our configuration property classes does not seem to work anymore, so it is replaced by a BeanPostProcessor.

Fixes #852

* fix: update java version in github workflows

Fixes #852

* fix: fix itest issues
Fixes #852

* fix: properly fix the issue with multiple cached contexts using the same test database

Fixes #852

* chore: bump axon-gateway-extension to 2.0.0

Fixes #852

* fix: avoid exceptions being logged when looking for an aggregate that might or might not be there

Fixes #852

* chore(deps): bump axon-gateway-extension.version from 1.1.2 to 2.0.0 (#870)

* fix #862: Made start form key retrieval more robust

* chore(deps): bump org.jetbrains.dokka:dokka-maven-plugin (#860)

Bumps [org.jetbrains.dokka:dokka-maven-plugin](https://github.com/Kotlin/dokka) from 1.8.20 to 1.9.0.
- [Release notes](https://github.com/Kotlin/dokka/releases)
- [Commits](Kotlin/dokka@v1.8.20...v1.9.0)

---
updated-dependencies:
- dependency-name: org.jetbrains.dokka:dokka-maven-plugin
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore(deps): bump org.apache.maven.plugins:maven-enforcer-plugin (#866)

Bumps [org.apache.maven.plugins:maven-enforcer-plugin](https://github.com/apache/maven-enforcer) from 3.4.0 to 3.4.1.
- [Release notes](https://github.com/apache/maven-enforcer/releases)
- [Commits](apache/maven-enforcer@enforcer-3.4.0...enforcer-3.4.1)

---
updated-dependencies:
- dependency-name: org.apache.maven.plugins:maven-enforcer-plugin
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore(deps): bump jgiven.version from 1.2.5 to 1.3.0 (#868)

Bumps `jgiven.version` from 1.2.5 to 1.3.0.

Updates `com.tngtech.jgiven:jgiven-junit5` from 1.2.5 to 1.3.0
- [Release notes](https://github.com/TNG/jgiven/releases)
- [Changelog](https://github.com/TNG/JGiven/blob/master/CHANGELOG.md)
- [Commits](TNG/JGiven@v1.2.5...v1.3.0)

Updates `com.tngtech.jgiven:jgiven-spring` from 1.2.5 to 1.3.0
- [Release notes](https://github.com/TNG/jgiven/releases)
- [Changelog](https://github.com/TNG/JGiven/blob/master/CHANGELOG.md)
- [Commits](TNG/JGiven@v1.2.5...v1.3.0)

Updates `com.tngtech.jgiven:jgiven-spring-junit5` from 1.2.5 to 1.3.0
- [Release notes](https://github.com/TNG/jgiven/releases)
- [Changelog](https://github.com/TNG/JGiven/blob/master/CHANGELOG.md)
- [Commits](TNG/JGiven@v1.2.5...v1.3.0)

Updates `com.tngtech.jgiven:jgiven-html5-report` from 1.2.5 to 1.3.0
- [Release notes](https://github.com/TNG/jgiven/releases)
- [Changelog](https://github.com/TNG/JGiven/blob/master/CHANGELOG.md)
- [Commits](TNG/JGiven@v1.2.5...v1.3.0)

---
updated-dependencies:
- dependency-name: com.tngtech.jgiven:jgiven-junit5
  dependency-type: direct:production
  update-type: version-update:semver-minor
- dependency-name: com.tngtech.jgiven:jgiven-spring
  dependency-type: direct:production
  update-type: version-update:semver-minor
- dependency-name: com.tngtech.jgiven:jgiven-spring-junit5
  dependency-type: direct:production
  update-type: version-update:semver-minor
- dependency-name: com.tngtech.jgiven:jgiven-html5-report
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* chore(deps): bump axon-gateway-extension.version from 1.1.2 to 2.0.0

Bumps `axon-gateway-extension.version` from 1.1.2 to 2.0.0.

Updates `io.holixon.axon.gateway:axon-gateway-extension` from 1.1.2 to 2.0.0
- [Release notes](https://github.com/holixon/axon-gateway-extension/releases)
- [Commits](holixon/axon-gateway-extension@1.1.2...2.0.0)

Updates `io.holixon.axon.gateway:axon-gateway-spring-boot-starter` from 1.1.2 to 2.0.0

---
updated-dependencies:
- dependency-name: io.holixon.axon.gateway:axon-gateway-extension
  dependency-type: direct:production
  update-type: version-update:semver-major
- dependency-name: io.holixon.axon.gateway:axon-gateway-spring-boot-starter
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: Tim Silhan <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Simon Zambrovski <[email protected]>

* enable snapshot production from a special branch

* fix process TTL

* add coverage to codecov

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: Lars Bilger <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Tim Silhan <[email protected]>
  • Loading branch information
4 people authored Oct 16, 2023
1 parent 4443f64 commit 8f5de3c
Show file tree
Hide file tree
Showing 105 changed files with 481 additions and 429 deletions.
1 change: 1 addition & 0 deletions .codacy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ exclude_paths:
- "README.md"
- ".github/**"
- "docs/**"
- "**/src/test/resources/**.sql"
18 changes: 9 additions & 9 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,12 @@ on:
branches:
- '!master'
- '!develop'
- '!release/*'
- 'dependabot/**'
- 'feature/**'
- 'bugfix/**'
- '!snapshot-producer'
- '**'

jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
jdk: ['11.0.5']
steps:
- name: Checkout code
uses: actions/checkout@v3
Expand All @@ -25,7 +19,7 @@ jobs:
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: ${{ matrix.jdk }}
java-version: 17
cache: maven

- name: Prepare Maven Wrapper
Expand All @@ -44,3 +38,9 @@ jobs:
uses: codecov/codecov-action@v3
with:
token: "${{ secrets.CODECOV_TOKEN }}"

- name: Upload test coverage to Codacy
if: github.event_name == 'push' && github.actor != 'dependabot[bot]'
run: bash <(curl -Ls https://coverage.codacy.com/get.sh)
env:
CODACY_PROJECT_TOKEN: "${{secrets.CODACY_PROJECT_TOKEN}}"
14 changes: 11 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:
branches:
- master
- develop
- snapshot-producer

jobs:
build:
Expand All @@ -21,10 +22,10 @@ jobs:
run: echo ${{ secrets.GPG_SECRET_KEYS }} | base64 --decode | gpg --import --no-tty --batch --yes

# Setup JDK and Maven
- name: Set up JDK 11
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: 11.0.5
java-version: 17
distribution: 'zulu'
cache: maven
server-id: ossrh
Expand All @@ -49,7 +50,14 @@ jobs:
OSS_CENTRAL_USERNAME: "${{ secrets.SONATYPE_USERNAME }}"
OSS_CENTRAL_PASSWORD: "${{ secrets.SONATYPE_PASSWORD }}"

- name: Upload coverage information
- name: Upload coverage information to CodeCov
uses: codecov/codecov-action@v3
with:
token: "${{ secrets.CODECOV_TOKEN }}"

- name: Upload test coverage to Codacy
if: github.event_name == 'push' && github.actor != 'dependabot[bot]'
run: bash <(curl -Ls https://coverage.codacy.com/get.sh)
env:
CODACY_PROJECT_TOKEN: "${{secrets.CODACY_PROJECT_TOKEN}}"

2 changes: 1 addition & 1 deletion bom/datapool-dependencies/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>io.holunda.polyflow</groupId>
<artifactId>polyflow-parent</artifactId>
<version>3.19.2-SNAPSHOT</version>
<version>4.0.0-SNAPSHOT</version>
<relativePath>../parent/pom.xml</relativePath>
</parent>

Expand Down
31 changes: 19 additions & 12 deletions bom/parent/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>io.holunda.polyflow</groupId>
<artifactId>polyflow-root</artifactId>
<version>3.19.2-SNAPSHOT</version>
<version>4.0.0-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>

Expand All @@ -18,18 +18,18 @@
<url>https://github.com/holunda-io/camunda-bpm-taskpool/</url>

<properties>
<springboot.version>2.7.16</springboot.version>
<camunda-commons-typed-values.version>7.19.0</camunda-commons-typed-values.version>
<axon-bom.version>4.6.6</axon-bom.version>
<axon-kotlin.version>4.7.0</axon-kotlin.version>
<axon-gateway-extension.version>1.1.2</axon-gateway-extension.version>
<springboot.version>3.1.4</springboot.version>
<camunda-commons-typed-values.version>7.20.0</camunda-commons-typed-values.version>

<awaitability.version>4.2.0</awaitability.version>
<axon-bom.version>4.8.2</axon-bom.version>
<axon-kotlin.version>4.8.0</axon-kotlin.version>
<axon-gateway-extension.version>2.0.0</axon-gateway-extension.version>

<awaitility.version>4.2.0</awaitility.version>
<mockito-kotlin.version>5.1.0</mockito-kotlin.version>
<jgiven.version>1.3.0</jgiven.version>
<jgiven-kotlin.version>1.3.0.0</jgiven-kotlin.version>


<pattern.class.itest>**/*ITest.*</pattern.class.itest>
<pattern.package.itest>**/itest/**/*.*</pattern.package.itest>
</properties>
Expand All @@ -40,6 +40,7 @@
<module>../../core/taskpool</module>
<module>../../core/datapool</module>
<module>../../core/bus-jackson</module>
<module>../../core/spring-utils</module>
<module>../../view</module>
<module>../taskpool-dependencies</module>
<module>../datapool-dependencies</module>
Expand Down Expand Up @@ -103,6 +104,11 @@
<artifactId>polyflow-bus-jackson</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>io.holunda.polyflow</groupId>
<artifactId>polyflow-spring-utils</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>io.holunda.polyflow</groupId>
<artifactId>polyflow-taskpool-sender</artifactId>
Expand Down Expand Up @@ -218,7 +224,7 @@
<dependency>
<groupId>org.awaitility</groupId>
<artifactId>awaitility</artifactId>
<version>${awaitability.version}</version>
<version>${awaitility.version}</version>
<scope>test</scope>
</dependency>
<dependency>
Expand Down Expand Up @@ -445,8 +451,8 @@
<version>${kotlin.version}</version>
<configuration>
<jvmTarget>${java.version}</jvmTarget>
<apiVersion>1.8</apiVersion>
<languageVersion>1.8</languageVersion>
<apiVersion>1.9</apiVersion>
<languageVersion>1.9</languageVersion>
<args>
<arg>-Xjsr305=strict</arg>
</args>
Expand Down Expand Up @@ -549,7 +555,8 @@
</includes>
<!-- Sets the VM argument line used when integration tests are run. -->
<!-- prevent the annoying ForkedBooter process from stealing window focus on Mac OS -->
<argLine>-Djava.awt.headless=true @{failsafeArgLine} -XX:+StartAttachListener</argLine>
<!-- the add-opens is required for XStream -->
<argLine>-Djava.awt.headless=true @{failsafeArgLine} -XX:+StartAttachListener --add-opens java.base/java.util=ALL-UNNAMED</argLine>
</configuration>
</plugin>

Expand Down
2 changes: 1 addition & 1 deletion bom/taskpool-dependencies/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>io.holunda.polyflow</groupId>
<artifactId>polyflow-parent</artifactId>
<version>3.19.2-SNAPSHOT</version>
<version>4.0.0-SNAPSHOT</version>
<relativePath>../parent/pom.xml</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion core/bus-jackson/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>io.holunda.polyflow</groupId>
<artifactId>polyflow-parent</artifactId>
<version>3.19.2-SNAPSHOT</version>
<version>4.0.0-SNAPSHOT</version>
<relativePath>../../bom/parent/pom.xml</relativePath>
</parent>

Expand Down
2 changes: 0 additions & 2 deletions core/bus-jackson/src/main/resources/META-INF/spring.factories

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
io.holunda.polyflow.bus.jackson.config.FallbackPayloadObjectMapperAutoConfiguration
5 changes: 3 additions & 2 deletions core/datapool/datapool-api/pom.xml
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>io.holunda.polyflow</groupId>
<artifactId>polyflow-datapool-parent</artifactId>
<version>3.19.2-SNAPSHOT</version>
<version>4.0.0-SNAPSHOT</version>
</parent>

<artifactId>polyflow-datapool-api</artifactId>
Expand Down
7 changes: 4 additions & 3 deletions core/datapool/datapool-core/pom.xml
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>io.holunda.polyflow</groupId>
<artifactId>polyflow-datapool-parent</artifactId>
<version>3.19.2-SNAPSHOT</version>
<version>4.0.0-SNAPSHOT</version>
</parent>

<artifactId>polyflow-datapool-core</artifactId>
Expand Down Expand Up @@ -35,7 +36,7 @@
</dependency>
<!-- DOM4J for upcasters -->
<dependency>
<groupId>org.dom4j</groupId>
<groupId>org.dom4j</groupId>
<artifactId>dom4j</artifactId>
<version>2.1.4</version>
</dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,10 @@ package io.holunda.polyflow.datapool.core

import org.axonframework.eventsourcing.EventSourcingRepository
import org.springframework.boot.context.properties.ConfigurationProperties
import org.springframework.boot.context.properties.ConstructorBinding

/**
* Properties effecting data pool command model.
*/
@ConstructorBinding
@ConfigurationProperties(prefix = "polyflow.core.data-entry")
data class DataPoolProperties(
/**
Expand All @@ -26,4 +24,4 @@ data class DataPoolProperties(
* Specifies the deletion strategy for data entries.
*/
val deletionStrategy: DeletionStrategyValue? = DeletionStrategyValue.lax
)
)
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import io.holunda.camunda.taskpool.api.business.CreateDataEntryCommand
import io.holunda.camunda.taskpool.api.business.CreateOrUpdateDataEntryCommand
import io.holunda.camunda.taskpool.api.business.UpdateDataEntryCommand
import io.holunda.polyflow.datapool.core.DeletionStrategy
import io.holunda.polyflow.datapool.ifPresentOrElse
import mu.KLogging
import org.axonframework.commandhandling.CommandHandler
import org.axonframework.eventsourcing.EventSourcingRepository
Expand All @@ -23,7 +22,8 @@ class CreateOrUpdateCommandHandler(
private val deletionStrategy: DeletionStrategy
) {

companion object: KLogging()
companion object : KLogging()

/**
* Receives create-or-update and decides what to do.
* @param command command to create or update the aggregate.
Expand All @@ -32,31 +32,31 @@ class CreateOrUpdateCommandHandler(
@CommandHandler
fun createOrUpdate(command: CreateOrUpdateDataEntryCommand, metaData: MetaData) {
logger.trace { "Processing createOrUpdate command for ${command.dataIdentity}" }
loadAggregate(command.dataIdentity).ifPresentOrElse(
presentConsumer = { aggregate ->
val updateCommand = UpdateDataEntryCommand(
dataEntryChange = command.dataEntryChange
)
logger.trace { "Aggregate found. Updating it passing command $updateCommand" }
aggregate.invoke {
it.handle(
command = updateCommand,
deletionStrategy = deletionStrategy
)
}
},
missingCallback = {
val createCommand = CreateDataEntryCommand(
dataEntryChange = command.dataEntryChange
// Apply the command only once - either by creating a new aggregate instance or by updating the existing one
// If a new one is created, it should not be updated immediately afterward with the same data.
var commandApplied = false
val aggregate = eventSourcingRepository.loadOrCreate(command.dataIdentity) {
val createCommand = CreateDataEntryCommand(
dataEntryChange = command.dataEntryChange
)
logger.trace { "No aggregate found. Creating a new data entry aggregate and passing command $command" }
commandApplied = true
DataEntryAggregate(
command = createCommand
)
}
if (!commandApplied) {
val updateCommand = UpdateDataEntryCommand(
dataEntryChange = command.dataEntryChange
)
logger.trace { "Aggregate found. Updating it passing command $updateCommand" }
aggregate.invoke {
it.handle(
command = updateCommand,
deletionStrategy = deletionStrategy
)
logger.trace { "No aggregate found. Creating a new data entry aggregate and passing command $command" }
eventSourcingRepository.newInstance {
DataEntryAggregate(
command = createCommand
)
}
}
)
}
}

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
drop SEQUENCE hibernate_sequence;
create sequence association_value_entry_seq start with 1 increment by 50;
create sequence domain_event_entry_seq start with 1 increment by 50;
2 changes: 1 addition & 1 deletion core/datapool/datapool-event/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>io.holunda.polyflow</groupId>
<artifactId>polyflow-datapool-parent</artifactId>
<version>3.19.2-SNAPSHOT</version>
<version>4.0.0-SNAPSHOT</version>
</parent>

<artifactId>polyflow-datapool-event</artifactId>
Expand Down
5 changes: 3 additions & 2 deletions core/datapool/pom.xml
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>io.holunda.polyflow</groupId>
<artifactId>polyflow-parent</artifactId>
<version>3.19.2-SNAPSHOT</version>
<version>4.0.0-SNAPSHOT</version>
<relativePath>../../bom/parent/pom.xml</relativePath>
</parent>

Expand Down
29 changes: 29 additions & 0 deletions core/spring-utils/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>io.holunda.polyflow</groupId>
<artifactId>polyflow-parent</artifactId>
<version>4.0.0-SNAPSHOT</version>
<relativePath>../../bom/parent/pom.xml</relativePath>
</parent>

<artifactId>polyflow-spring-utils</artifactId>
<name>core/spring-utils/${project.artifactId}</name>

<dependencies>
<!-- Spring boot -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
</project>
Loading

0 comments on commit 8f5de3c

Please sign in to comment.