Skip to content

[#3879] Feature/introduce kotlin extension#3878

Closed
jangalinski wants to merge 1057 commits intomainfrom
feature/introduce-kotlin-extension
Closed

[#3879] Feature/introduce kotlin extension#3878
jangalinski wants to merge 1057 commits intomainfrom
feature/introduce-kotlin-extension

Conversation

@jangalinski
Copy link
Copy Markdown
Collaborator

@jangalinski jangalinski commented Nov 7, 2025

  • Import existing extension-kotlin into extensions/kotlin - keeping commit history
  • clean up maven setup and use correct parents
  • move everything not applicable (directly) to _todo

Closes AxonFramework/extension-kotlin#393. Takes over #3878 by @jangalinski.

Context

@jangalinski opened #3878 to import the extension-kotlin repository into
extensions/kotlin/ (with full commit history) and wire it into the monorepo build.
That PR intentionally stopped there: incompatible AF4 files were moved to _todo/
rather than rewritten, leaving the actual AF5 migration as follow-up work.

This PR completes that migration. The reference for every change is
extension-kotlin#394,
which performed the same migration against the standalone extension-kotlin
repository (targeting AF 5.1.0).


Differences from extension-kotlin#394

The monorepo integration required a few adjustments beyond a straight copy of the patch.

extensions/kotlin/pom.xml — parent and coordinates

PR#394 kept the standalone axon-kotlin-parent / 4.12.x-SNAPSHOT parent and
simply updated axon.version to 5.0.3.

Our branch replaces the entire parent with the monorepo coordinates:

  • parentaxon-extensions / 5.1.0-SNAPSHOT
  • version5.1.0-SNAPSHOT (inherited)
  • All standalone release/deploy/SCM infrastructure removed (sonatype, gpg, dokka,
    release-plugin, pluginRepositories, scm, developers, .github/, .editorconfig,
    mvnw, coverage-report/, etc.)
  • docs/ removed — AF4 Antora reference content imported via history, no AF5
    equivalent yet; reference docs update is a separate effort

Additionally the <log4j.version>2.13.3</log4j.version> property present in the
standalone pom was removed. In the monorepo it overrides the managed 2.25.3 version
and causes a Maven resolution failure (log4j-slf4j2-impl:2.13.3 does not exist in
Maven Central — only introduced in log4j 2.20).

CommandGatewayExtensions.ktsendAndWait null safety

CommandGateway.sendAndWait(Object, Class<R>) is @Nullable. PR#394 silently trusts
the platform type. Our branch adds ?: error(...) to fail fast with a clear message
pointing callers to sendForResult as the nullable alternative.

QueryUpdateEmitterExtensions.kt — type bound and SAM lambda

Two changes vs PR#394: Q : Any bound added (required to resolve the correct Java
overload), and filter wrapped in an explicit lambda to satisfy Predicate<? super Q>
unambiguously. @Suppress("UNCHECKED_CAST") covers the remaining compiler warning.


What was done (full summary)

Build (extensions/kotlin/pom.xml)

  • Parent changed to monorepo axon-extensions / 5.1.0-SNAPSHOT
  • Removed <log4j.version>2.13.3</log4j.version> (would break monorepo resolution)
  • Removed AF4 compile dependencies: jackson-module-kotlin,
    kotlinx-serialization-core, javax.xml.bind:jaxb-api
  • Removed all-open:annotation=...AggregateRoot compiler plugin option
  • axon-configurationaxon-messaging in dependency management

Deleted — AF4-only, no AF5 equivalent (yet)

File Reason
AggregateLifecycleExtensions.kt AggregateLifecycle / @AggregateRoot removed in AF5
BuilderExtensions.kt EventSourcingRepository / GenericJpaRepository builders not present in AF5
ResultDiscriminatorCommandCallback.kt CommandCallback / CommandResultMessage replaced by CommandResult
EventUpcaster.kt SingleEventUpcaster not available in AF5.0/5.1; tracked for 5.2
messaging/responsetypes/ArrayResponseType.kt AbstractResponseType removed; ResponseType hierarchy reworked
serialization/ (entire module) Serializer replaced by Converter; full rewrite out of scope — tracked as follow-up
META-INF/spring-devtools.properties Spring Boot DevTools dependency removed
All corresponding tests Deleted with their production classes

Rewritten for AF5

CommandGatewayExtensions.ktsend, sendForResult, sendAndWait over
CommandResult<R> (replaces AF4 CommandCallback / CommandResultMessage pattern).

QueryGatewayExtensions.ktquery, queryMany, subscriptionQuery retained;
scatterGather* replaced by streamingQuery; type bound R : Any on all functions
where R is used as Class<R>.

QueryUpdateEmitterExtensions.kt — package import updated to AF5;
Q : Any bound added; explicit SAM lambda for Predicate.

kotlin-test/FixtureExtensions.ktAggregateTestFixture / SagaTestFixture /
TestExecutor / ResultValidator replaced by the AF5 phase-based
AxonTestFixture / AxonTestPhase API; whenever(), whenever(command),
exception(KClass), exception(KClass, message) rewritten accordingly.

Tests

18 tests pass (12 in kotlin, 6 in kotlin-test). Test files are identical to
the ones in PR#394.

Documentation

README.md: versions 4.6.05.1.0-SNAPSHOT, CI/SonarCloud/CodeTriage badges
removed (standalone-repo artefacts), issue tracker URL updated to monorepo,
docs profile name corrected (javadoc-and-sourcesdocs-and-sources).


Out of scope / follow-up

Item Notes
KotlinSerializer / KotlinConverter Requires full rewrite against AF5 Converter API
EventUpcaster DSL SingleEventUpcaster absent from AF5.0/5.1; scheduled for 5.2

smcvb and others added 30 commits February 14, 2025 11:46
Update Axon Framework to 4.11.0

#dependency-upgrade/af-4.11.0
Set milestone to 4.11.1
Update version of non-deployed module
Add release notes for 4.11.0
Bumps the maven-dependencies group with 1 update: [io.projectreactor:reactor-core](https://github.com/reactor/reactor-core).


Updates `io.projectreactor:reactor-core` from 3.7.2 to 3.7.3
- [Release notes](https://github.com/reactor/reactor-core/releases)
- [Commits](reactor/reactor-core@v3.7.2...v3.7.3)

---
updated-dependencies:
- dependency-name: io.projectreactor:reactor-core
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: maven-dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>
…endencies-487047f72e

Bump io.projectreactor:reactor-core from 3.7.2 to 3.7.3 in the maven-dependencies group
Bumps the maven-dependencies group with 2 updates: [org.apache.maven.plugins:maven-clean-plugin](https://github.com/apache/maven-clean-plugin) and [org.apache.maven.plugins:maven-compiler-plugin](https://github.com/apache/maven-compiler-plugin).


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

Updates `org.apache.maven.plugins:maven-compiler-plugin` from 3.13.0 to 3.14.0
- [Release notes](https://github.com/apache/maven-compiler-plugin/releases)
- [Commits](apache/maven-compiler-plugin@maven-compiler-plugin-3.13.0...maven-compiler-plugin-3.14.0)

---
updated-dependencies:
- dependency-name: org.apache.maven.plugins:maven-clean-plugin
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: maven-dependencies
- dependency-name: org.apache.maven.plugins:maven-compiler-plugin
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: maven-dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>
…endencies-125d9543ee

Bump the maven-dependencies group with 2 updates
Bumps the maven-dependencies group with 3 updates: org.slf4j:slf4j-simple, [org.apache.maven.plugins:maven-install-plugin](https://github.com/apache/maven-install-plugin) and [org.apache.maven.plugins:maven-deploy-plugin](https://github.com/apache/maven-deploy-plugin).


Updates `org.slf4j:slf4j-simple` from 2.0.16 to 2.0.17

Updates `org.apache.maven.plugins:maven-install-plugin` from 3.1.3 to 3.1.4
- [Release notes](https://github.com/apache/maven-install-plugin/releases)
- [Commits](apache/maven-install-plugin@maven-install-plugin-3.1.3...maven-install-plugin-3.1.4)

Updates `org.apache.maven.plugins:maven-deploy-plugin` from 3.1.3 to 3.1.4
- [Release notes](https://github.com/apache/maven-deploy-plugin/releases)
- [Commits](apache/maven-deploy-plugin@maven-deploy-plugin-3.1.3...maven-deploy-plugin-3.1.4)

---
updated-dependencies:
- dependency-name: org.slf4j:slf4j-simple
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: maven-dependencies
- dependency-name: org.apache.maven.plugins:maven-install-plugin
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: maven-dependencies
- dependency-name: org.apache.maven.plugins:maven-deploy-plugin
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: maven-dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>
…endencies-0a39d4d2af

Bump the maven-dependencies group with 3 updates
Bumps the maven-dependencies group with 1 update: [io.projectreactor:reactor-core](https://github.com/reactor/reactor-core).


Updates `io.projectreactor:reactor-core` from 3.7.3 to 3.7.4
- [Release notes](https://github.com/reactor/reactor-core/releases)
- [Commits](reactor/reactor-core@v3.7.3...v3.7.4)

---
updated-dependencies:
- dependency-name: io.projectreactor:reactor-core
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: maven-dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>
…endencies-53245d561c

Bump io.projectreactor:reactor-core from 3.7.3 to 3.7.4 in the maven-dependencies group
Bumps the maven-dependencies group with 1 update: [org.apache.maven.plugins:maven-surefire-plugin](https://github.com/apache/maven-surefire).


Updates `org.apache.maven.plugins:maven-surefire-plugin` from 3.5.2 to 3.5.3
- [Release notes](https://github.com/apache/maven-surefire/releases)
- [Commits](apache/maven-surefire@surefire-3.5.2...surefire-3.5.3)

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

Signed-off-by: dependabot[bot] <support@github.com>
…endencies-9b5e3112d5

Bump org.apache.maven.plugins:maven-surefire-plugin from 3.5.2 to 3.5.3 in the maven-dependencies group
Bumps the github-dependencies group with 1 update: [actions/setup-java](https://github.com/actions/setup-java).


Updates `actions/setup-java` from 4.7.0 to 4.7.1
- [Release notes](https://github.com/actions/setup-java/releases)
- [Commits](actions/setup-java@v4.7.0...v4.7.1)

---
updated-dependencies:
- dependency-name: actions/setup-java
  dependency-version: 4.7.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>
…github-dependencies-195b2b4ccf

Bump actions/setup-java from 4.7.0 to 4.7.1 in the github-dependencies group
Bumps the maven-dependencies group with 1 update: [io.projectreactor:reactor-core](https://github.com/reactor/reactor-core).


Updates `io.projectreactor:reactor-core` from 3.7.4 to 3.7.5
- [Release notes](https://github.com/reactor/reactor-core/releases)
- [Commits](reactor/reactor-core@v3.7.4...v3.7.5)

---
updated-dependencies:
- dependency-name: io.projectreactor:reactor-core
  dependency-version: 3.7.5
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: maven-dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>
…endencies-3d8680518b

Bump io.projectreactor:reactor-core from 3.7.4 to 3.7.5 in the maven-dependencies group
smcvb and others added 25 commits April 16, 2026 16:36
Switch to new Sonar settings. With Axon Framework moved to the AxonIQ GitHub organization, we need to adjust the project key and organization reference
Set AxonServer-detail containing modules to 5.1.0-RC2. This allows us to not adjust the examples just yet.
Align Sonar settings with repository organization transfer
The Distributed Command Bus moves to Axoniq Framework, so we also move the related documentation, leaving a reference in the Commands > Infrastructure section.
The Dead Letter Queue moves to Axoniq Framework, so we also move the related documentation, leaving a reference in the Events > Event Processors section.
The Axon Server Event Storage Engine moves to Axoniq Framework, so we also move the related documentation, leaving a reference in the Events > Infrastructure section.
The Axon Server Testcontainer facility moves to Axoniq Framework, so we also move the related documentation, leaving a reference in the Testing > Advanced Testing section.
To still allow building the Axon Framework documentation locally using antora, we introduce a new playbook source for the axon-framework-reference antora component in `_reference-guide-preview` (keeping `_` in front to filter it for the full library build) that defines the start page and is holding the previous ROOT nav.adoc as main navigation. The playbook.yaml / playbook-dev-ui.yaml are adjusted to include this new source for local builds.
* adjust section naming
* restructure extensions section
* remove references to Axoniq extensions/modules
The tracing module moves to Axoniq Framework, so we also move the related documentation, leaving references in the Monitoring section
The Distributed Query Bus moves to Axoniq Framework, so we also move the related documentation, leaving a reference in the Queries > Infrastructure section.
The Spring Boot university examples are designed to run against the
published 5.1.0-RC2 release, which still includes Axon Server support.
However, when built via `-Pexamples` as part of the main reactor, Maven
was resolving all Axon framework artifacts (core modules and Spring
extensions) to the local 5.1.0-SNAPSHOT build instead of the intended
RC2 releases.

On this branch the local SNAPSHOT has AxonServerAutoConfiguration
removed from the autoconfigure module and the spring.factories
ConnectionDetailsFactories stripped out. The axon-server-connector:RC2
jar still self-registers AxonServerConfigurationEnhancer via
ServiceLoader, so tests attempted an Axon Server connection — but
without the Spring glue that used to wire the test context (Testcontainer
address, axon.axonserver.enabled guard) into that connection, every test
context startup failed with "no connection to AxonServer".

Root cause: examples/pom.xml imported axon-framework-bom at
${project.version} (SNAPSHOT). This BOM covers all core and Spring
extension modules, so the managed versions all resolved to SNAPSHOT,
which the reactor then supplied from the local build.

Fix: import axon-framework-bom at 5.1.0-RC2. Maven now requests the
release coordinates (5.1.0-RC2) for every managed Axon artifact; the
reactor only has 5.1.0-SNAPSHOT, so it is not a match and Maven fetches
the published RC2 artifacts from Maven Central. Both local and CI builds
are affected equally, requiring no additional CI configuration changes.
Disable examples GHA. The examples are brittle at the moment, as they need to depend on the axon-server-connector module, which has not yet seen a release in Axoniq Framework. Added a todo referring to an issue number to tackle this on the first (RC) release of Axoniq Framework.
…onnector

Move Axon Server integration to Axoniq Framework
- Move most of the complicated logic to AbstractMessageStream for
streams deriving from it
- Made AbstractMessageStream safe to extend without breaking its
invariants
- Based FluxMessageStream on AbstractMessageStream
- Based ConcatenatingMessageStream on AbstractMessageStream
- Simplified ConcatenatingMessageStream using active stream logic
- Removed unused code from QueueMessageStream and renamed methods for
clarity
The Snapshotting and Caching functionality moves to Axoniq Framework, so we also move the related documentation, leaving references in the Tuning section.
To allow cross-repository builds for Axon Framework and Axoniq Framework documentation without requiring both repositories being on the same branch, we widen the fallback in the antora.yml.
For the axoniq-library-site build, a branch filtering is applied to avoid getting feature branches picked up.
…cumentation

Prepare composite Axon Framework / Axoniq Framework documentation
…stream

Refactor AbstractMessageStream and implementations
@jangalinski
Copy link
Copy Markdown
Collaborator Author

Closing this in favor of #4432 (target: axon-5.1.x)

@smcvb smcvb removed this from the Release 5.2.0 milestone Apr 20, 2026
@smcvb smcvb added the Status: Obsolete Use to signal this issue is no longer necessary. label Apr 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Priority 2: Should High priority. Ideally, these issues are part of the release they’re assigned to. Status: Obsolete Use to signal this issue is no longer necessary. Type: Feature Use to signal an issue is completely new to the project.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Migrate Kotlin extension to Axon Framework 5

9 participants