Skip to content

Port 5.1.x to main#4472

Merged
hatzlj merged 23 commits intomainfrom
port/port-5.1.x-main
Apr 28, 2026
Merged

Port 5.1.x to main#4472
hatzlj merged 23 commits intomainfrom
port/port-5.1.x-main

Conversation

hatzlj and others added 23 commits April 23, 2026 19:31
…gateBasedJpaEventStorageEngine

When sourcing an empty event stream in the AggregateBasedJpaEventStorageEngine, the consistency marker included in the context of the Terminal message is pointing to position 1, resulting in 1-based sequence numbers for aggregates in the AggregateBasedJpaEventStorageEngine.

While this is technically acceptable for appending events to the AggregateBasedJpaEventStorageEngine, it is inconsistent with the behaviour of the JpaEventStorageEngine, which produced 0 based sequence numbers.

This commit adjusts the behavior so that for an empty stream the consistency marker points to position 0, resulting in 0-based sequence numbers.
…empty stream works

To check against a regression for #4437, we introduce an additional test case that makes sure events can be appended based on the consistency marker returned from sourcing an empty stream.
…-empty-stream-aggregate-based-consistency-marker

[#4437] Fix consistency marker when sourcing an empty stream in the AggregateBasedJpaEventStorageEngine
Add test case validating empty optionals can be returned. An empty optional may happen if the Value record of the FetchResult contains a null MessageStream.Entry, which may happen.

#4455
Use Optional#ofNullable for possible null Entry. An empty optional may happen if the Value record of the FetchResult contains a null MessageStream.Entry, when fetchNext() is invoked.

#4455
Clarify nullability of the Entry. The FetchResult should dictate that the Entry inside may be null

#4455
Adjust JavaDoc inconsistencies by:
* Using non-sentence style for any parameter
* Add missing constructor JavaDoc
* Use {@code ...} i.o. {@link ...} for self references
* Clean-up JavaDoc indentation

#4455
Clean-up toString() logic by:
* Marking describeFlags() as nullable
* Marking describeDelegates() as nullable
* Adjusting the indentation of toString() for clarity

#4455
Adjust case parameter names. Rename error to throwable, as the parent block already refers to error. Furthermore, rename value to ignored, as it's not used

#4455
Final indent clean-up

#4455
Resolve warnings by:
* Marking a method as returning NonNull
* Suppressing intentional use of null
* Minor comment fix

#4455
…sage-stream

[#4455] Support a `null` `MessageStream.Entry` on the `AbstractMessageStream.FetchResult`
…rence guide

Replace the todos left behind in the reference guide for AxoniqFramework with the new role (that will render as css class in the rendered html we can act on)
Replace all mentions of base / advanced framework with Axon Framework and Axoniq Framework respectively
…ual-indicator

Add Visual indicator for features moved to Axoniq Framework
- [x] Import existing
[extension-kotlin](https://github.com/AxonFramework/extension-kotlin)
into `extensions/kotlin` - keeping commit history
- [x] clean up maven setup and use correct parents
- [x] move everything not applicable (directly) to `_todo`

----

Closes AxonFramework/extension-kotlin#393.
Takes over
[#3878](#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](AxonFramework/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:
- `parent` → `axon-extensions` / `5.1.0-SNAPSHOT`
- `version` → `5.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.kt` — `sendAndWait` 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-configuration` → `axon-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.kt`** — `send`, `sendForResult`,
`sendAndWait` over
`CommandResult<R>` (replaces AF4 `CommandCallback` /
`CommandResultMessage` pattern).

**`QueryGatewayExtensions.kt`** — `query`, `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.kt`** — `AggregateTestFixture` /
`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.0` → `5.1.0-SNAPSHOT`,
CI/SonarCloud/CodeTriage badges
removed (standalone-repo artefacts), issue tracker URL updated to
monorepo,
docs profile name corrected (`javadoc-and-sources` →
`docs-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 |

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: Steven van Beelen <steven.vanbeelen@axoniq.io>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: David Gómez G <dgomezg@gmail.com>
Co-authored-by: Mitchell Herrijgers <mitchellherrijgers@gmail.com>
Co-authored-by: Mateusz Nowak <mateusz@dddheroes.com>
Co-authored-by: Allard Buijze <allard.buijze@axoniq.io>
Co-authored-by: Mateusz Nowak <mateusz@nakodach.pl>
Co-authored-by: Simon Zambrovski <simon.zambrovski@holisticon.de>
Co-authored-by: vcanuel <167304+vcanuel@users.noreply.github.com>
The Axoniq Framework repository currently holds the main parts of the documentation including the basic navigation.
Since we're using a distributed component to integrate Axoniq Framework and other parts in the reference guide and the main contents are actually living in the Axon Framework repository, we want to have those files and the main antora setup in this repository being the main entrypoint containing all additional configurations in the antora.yml.

By doing that, we don't need the filtered-out preview module anymore.
When locally building the docs, force Antora to skip the cache and ensure to use the latest ui-bundle (see https://docs.antora.org/antora/latest/playbook/ui-bundle-url/#snapshot).
Update the Antora versioning of the guide modules to default to `development` for main and feature branches
…reference-doc

Include Workflows documentation in the reference guide
# Conflicts:
#	docs/_playbook/playbook-dev-ui.yaml
#	docs/_playbook/playbook.yaml
#	messaging/src/main/java/org/axonframework/messaging/core/AbstractMessageStream.java
@hatzlj hatzlj added this to the Release 5.1.0 milestone Apr 27, 2026
@hatzlj hatzlj self-assigned this Apr 27, 2026
@hatzlj hatzlj requested a review from a team as a code owner April 27, 2026 19:06
@hatzlj hatzlj added the Priority 1: Must Highest priority. A release cannot be made if this issue isn’t resolved. label Apr 27, 2026
@hatzlj hatzlj requested review from hjohn and jangalinski and removed request for a team April 27, 2026 19:06
@hatzlj hatzlj requested a review from MateuszNaKodach April 27, 2026 19:06
@sonarqubecloud
Copy link
Copy Markdown

@hatzlj hatzlj merged commit 2c24538 into main Apr 28, 2026
10 checks passed
@hatzlj hatzlj deleted the port/port-5.1.x-main branch April 28, 2026 08:28
@smcvb smcvb added the Type: Port Use to refer to an issue or pull request that ports logic from one branch to another. label Apr 28, 2026
@smcvb smcvb modified the milestones: Release 5.1.0, Release 5.2.0 Apr 28, 2026
Copy link
Copy Markdown
Contributor

@smcvb smcvb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Priority 1: Must Highest priority. A release cannot be made if this issue isn’t resolved. Type: Port Use to refer to an issue or pull request that ports logic from one branch to another.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants