Skip to content

Honor TrackingToken.FIRST and LATEST in MultiStreamableEventSource - #542

Open
hjohn wants to merge 1 commit into
mainfrom
multistreamable-first-token
Open

hjohn wants to merge 1 commit into
mainfrom
multistreamable-first-token

Conversation

@hjohn

@hjohn hjohn commented Sep 28, 2026

Copy link
Copy Markdown
Contributor

Companion to AxonIQ/AxonFramework#5086. MultiStreamableEventSource.open() only handled a null position as "start from the beginning" and never handled TrackingToken.LATEST at all, so both FIRST and LATEST threw IllegalArgumentException instead of resolving. AxonFramework's StartingFrom now normalizes null to FIRST, so the null branch here would go dead without this change.

  • Resolve FIRST via firstToken() (same as the previous null handling) and LATEST via latestToken(), for each underlying source.
  • No null fallback kept — AF and Axoniq release together, so there's no version skew to bridge.
  • Adds TrackingToken.FIRST/LATEST coverage; existing tests updated from startingFrom(null) to startingFrom(TrackingToken.FIRST).

Depends on the AxonFramework 5.4.0-SNAPSHOT build including AxonIQ/AxonFramework#5086 (also fixes AsyncInMemoryStreamableEventSource.latestToken() returning null on an empty store, which the new LATEST test here exposed).

open() only recognized a null position as "start from the beginning" and
had no handling for LATEST at all, so both TrackingToken.FIRST and LATEST
threw an IllegalArgumentException instead of resolving like every other
StreamableEventSource. AxonFramework's StartingFrom now normalizes null to
FIRST, so the null branch here would have gone dead without this change.

Resolve FIRST and LATEST the same way as the existing null case, via each
source's firstToken()/latestToken(). No backward-compatible null handling
kept, since AF and Axoniq ship as a single coordinated release.
@sonarqubecloud

Copy link
Copy Markdown

❌ The last analysis has failed.

See analysis details on SonarQube Cloud

@hjohn hjohn self-assigned this Sep 28, 2026
@hjohn hjohn added Priority 3: Could Low priority. Issues that are nice to have but have a straightforward workaround. Type: Bug Use to signal issues that describe a bug within the system. labels Sep 28, 2026
@hjohn hjohn added this to the Release 5.4.0 milestone Sep 28, 2026
@hjohn
hjohn marked this pull request as ready for review September 28, 2026 11:56
@hjohn
hjohn requested a review from a team as a code owner September 28, 2026 11:56
@hjohn
hjohn requested review from MateuszNaKodach, jangalinski and zambrovski and removed request for a team September 28, 2026 11:56
@github-actions

Copy link
Copy Markdown
Contributor

Build status (run 36418446130, commit 0a1a493)

JDK 21 - FAILURE - 17 succeeded, 1 failed, 13 skipped (0 cached, 18 built) in 12:08

Per-module details
ModuleCacheTime
✅ axoniq-frameworkbuilt00:00
✅ axoniq-test-loggingbuilt00:01
✅ axoniq-framework-parentbuilt00:01
✅ axoniq-framework-bombuilt00:00
✅ axoniq-postgresqlbuilt00:57
✅ axoniq-distributed-messagingbuilt00:16
✅ axoniq-testcontainerbuilt03:23
✅ axon-server-connectorbuilt03:24
✅ axoniq-dead-letterbuilt00:45
❌ axoniq-event-streamingbuilt00:15
io.​axoniq.​framework.​messaging.​eventstreaming.​Multi​Streamable​Event​Source​Test.​open​With​Latest​Token​Skips​Existing​Events - Expecting value to be true but was false
⚠️ axoniq-multi-tenancy--
✅ axoniq-tracing-micrometerbuilt00:06
✅ axoniq-framework-springbuilt00:00
⚠️ axoniq-spring-boot-autoconfigure--
⚠️ axoniq-spring-boot-starter--
✅ axoniq-integrationtestsbuilt00:00
✅ axoniq-integrationtests-supportbuilt00:01
✅ axoniq-integrationtests-connectorbuilt00:00
⚠️ axoniq-integrationtests-conformance--
✅ axoniq-integrationtests-tracingbuilt00:48
✅ axoniq-integrationtests-dead-letterbuilt00:05
⚠️ axoniq-workflow-parent--
⚠️ axoniq-workflow-engine--
⚠️ axoniq-workflow-dsl--
⚠️ axoniq-workflow-test--
⚠️ axoniq-integrationtests-workflow--
✅ axoniq-message-transformationbuilt00:12
⚠️ axoniq-workflow-dsl-kotlin--
⚠️ axoniq-workflow-spring-boot--
⚠️ axoniq-workflow-spring-boot-kotlin--
⚠️ axoniq-docs-samples--

JDK 25 - FAILURE - 17 succeeded, 1 failed, 13 skipped (0 cached, 18 built) in 12:50

Per-module details
ModuleCacheTime
✅ axoniq-frameworkbuilt00:01
✅ axoniq-test-loggingbuilt00:01
✅ axoniq-framework-parentbuilt00:01
✅ axoniq-framework-bombuilt00:00
✅ axoniq-postgresqlbuilt01:03
✅ axoniq-distributed-messagingbuilt00:17
✅ axoniq-testcontainerbuilt03:27
✅ axon-server-connectorbuilt03:37
✅ axoniq-dead-letterbuilt00:46
❌ axoniq-event-streamingbuilt00:16
io.​axoniq.​framework.​messaging.​eventstreaming.​Multi​Streamable​Event​Source​Test.​open​With​Latest​Token​Skips​Existing​Events - Expecting value to be true but was false
⚠️ axoniq-multi-tenancy--
✅ axoniq-tracing-micrometerbuilt00:06
✅ axoniq-framework-springbuilt00:00
⚠️ axoniq-spring-boot-autoconfigure--
⚠️ axoniq-spring-boot-starter--
✅ axoniq-integrationtestsbuilt00:00
✅ axoniq-integrationtests-supportbuilt00:01
✅ axoniq-integrationtests-connectorbuilt00:00
⚠️ axoniq-integrationtests-conformance--
✅ axoniq-integrationtests-tracingbuilt00:53
✅ axoniq-integrationtests-dead-letterbuilt00:05
⚠️ axoniq-workflow-parent--
⚠️ axoniq-workflow-engine--
⚠️ axoniq-workflow-dsl--
⚠️ axoniq-workflow-test--
⚠️ axoniq-integrationtests-workflow--
✅ axoniq-message-transformationbuilt00:12
⚠️ axoniq-workflow-dsl-kotlin--
⚠️ axoniq-workflow-spring-boot--
⚠️ axoniq-workflow-spring-boot-kotlin--
⚠️ axoniq-docs-samples--

@hjohn

hjohn commented Sep 28, 2026

Copy link
Copy Markdown
Contributor Author

This build will fail until the AF change is in

@smcvb smcvb modified the milestones: Release 5.4.0, Release 5.5.0 Oct 1, 2026
@smcvb smcvb added Priority 2: Should High priority. Ideally, these issues are part of the release they’re assigned to. and removed Priority 3: Could Low priority. Issues that are nice to have but have a straightforward workaround. labels Nov 16, 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. Type: Bug Use to signal issues that describe a bug within the system.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants