E530 feat(eventsourcing): EntityModule (DCB) enables different EventCritera for sourcing (loading events) and appending (consistency checking) by MateuszNaKodach · Pull Request #4125 · AxonFramework/AxonFramework · GitHub
[go: up one dir, main page]

Skip to content

feat(eventsourcing): EntityModule (DCB) enables different EventCritera for sourcing (loading events) and appending (consistency checking)#4125

Draft
MateuszNaKodach wants to merge 10 commits intomainfrom
feat/criteria-source-append
Draft

feat(eventsourcing): EntityModule (DCB) enables different EventCritera for sourcing (loading events) and appending (consistency checking)#4125
MateuszNaKodach wants to merge 10 commits intomainfrom
feat/criteria-source-append

Conversation

@MateuszNaKodach
Copy link
Contributor
@MateuszNaKodach MateuszNaKodach commented Jan 18, 2026

Summary

  • New annotations: @SourceCriteriaBuilder and @AppendCriteriaBuilder for separate criteria
  • EventStore interface: Added transaction(AppendCondition, ProcessingContext) method
  • EventSourcingRepository: Now supports two separate CriteriaResolver fields
  • AnnotationBasedCriteriaResolvers: Factory class that creates both resolvers with proper annotation precedence
  • Configuration modules: Updated to support criteriaResolvers(source, append) method

Annotation Precedence Rules

For Sourcing:

  1. @SourceCriteriaBuilder present -> use it
  2. Else @EventCriteriaBuilder present -> use it
  3. Else -> tag-based fallback (existing behavior)

For Appending:

  1. @AppendCriteriaBuilder present -> use it
  2. Else @EventCriteriaBuilder present -> use it
  3. Else -> tag-based fallback (existing behavior)

Note: @AppendCriteriaBuilder is allowed standalone (uses tag-based fallback for sourcing).

…ia for sourcing (loading events) and appending (consistency checking)

  - New annotations: @SourceCriteriaBuilder and @AppendCriteriaBuilder for separate criteria
  - EventStore interface: Added transaction(AppendCondition, ProcessingContext) method
  - EventSourcingRepository: Now supports two separate CriteriaResolver fields
  - AnnotationBasedCriteriaResolvers: Factory class that creates both resolvers with proper annotation precedence
  - Configuration modules: Updated to support criteriaResolvers(source, append) method
@MateuszNaKodach MateuszNaKodach self-assigned this Jan 18, 2026
@MateuszNaKodach MateuszNaKodach added Type: Feature Use to signal an issue is completely new to the project. Priority 2: Should High priority. Ideally, these issues are part of the release they’re assigned to. labels Jan 18, 2026
@smcvb smcvb added this to the Release 5.2.0 milestone Jan 19, 2026
* @see #transaction(ProcessingContext) for default behavior where append criteria
* is derived from source criteria
*/
EventStoreTransaction transaction(@Nullable AppendCondition appendCondition,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Do you expect here AppendConition or just EventCriteria for appendConidtion? If we calculate the marker from sourced events, I think there should be just EventCriteria, what do you think?

@sonarqubecloud
Copy link

@smcvb smcvb modified the milestones: Release 5.2.0, Release 5.3.0 Jan 20, 2026
@smcvb smcvb added Priority 3: Could Low priority. Issues that are nice to have but have a straightforward workaround. Status: Under Discussion Use to signal that the issue in question is being discussed. and removed Priority 2: Should High priority. Ideally, these issues are part of the release they’re assigned to. labels Jan 20, 2026
…ngine` implementations

- Introduced `consistencyMarker(TrackingToken)` method to bridge tracking tokens with consistency markers.
- Updated all `EventStorageEngine` implementations (`Jpa`, `InMemory`, `AxonServer`) to provide respective conversion logic.
- Added JavaDoc to `EventStorageEngine` interface detailing the method's purpose and usage.
…ultEventStoreTransaction`

- Added logic to handle standalone append criteria without sourcing, resolving markers from the latest token.
- Introduced `resolveAppendCondition` method for consistent and efficient marker resolution.
… in tests and allow nullable `sourceCriteriaResolver`

- Updated test assertions to verify `transaction` calls with `EventCriteria` and `ProcessingContext`.
- Made `sourceCriteriaResolver` nullable to enable standalone append scenarios without event sourcing.
…dd `appendCriteriaResolver` support in `EntityModule`

- Introduced `appendCriteriaResolver` to handle scenarios without event sourcing.
- Updated validation and component registration to accommodate nullable `sourceCriteriaResolver`.
@smcvb smcvb modified the milestones: Release 5.3.0, Release 5.1.0 Feb 16, 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 Feb 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. Status: Under Discussion Use to signal that the issue in question is being discussed. 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.

2 participants

0