AF5 model inspection - expose AF5 entity inspection over RSocket#146
Open
stefanmirkovic wants to merge 2 commits intorelease/2.0.5-SNAPSHOTfrom
Open
AF5 model inspection - expose AF5 entity inspection over RSocket#146stefanmirkovic wants to merge 2 commits intorelease/2.0.5-SNAPSHOTfrom
stefanmirkovic wants to merge 2 commits intorelease/2.0.5-SNAPSHOTfrom
Conversation
…a Axon's CriteriaResolver
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Adds RSocketModelInspectionResponder with four endpoints backed by AF5's StateManager and EventStorageEngine:
Tag keys are resolved from @eventsourced / @EventSourcedEntity annotations (including meta-annotations), falling back to the class's simple name. State reconstruction walks the full event stream to keep stateBefore accurate for the first event in the requested window, but only serializes snapshots for entries in [offset, offset + limit), bounding payload size regardless of stream length.
AxoniqPlatformModelInspectionEnhancer registers the responder via the ConfigurationEnhancer SPI. SetupPayloadCreator now reports hasStateManager so the platform can detect model inspection support.
Compound id + multi-tag support
Replaces the hand-crafted
EventCriteria.havingTags(Tag.of(tagKey, entityId))(single-tag only, breaks for multi-tag entities) with a delegation to the
framework's own
CriteriaResolver:resolveCriteria(entityType, entityId)extracts the live resolver from theregistered
EventSourcingRepositoryvia reflection, honoring any customresolver the application has configured. Falls back to constructing a fresh
AnnotationBasedEventCriteriaResolver(entityClass, idClass, configuration)lookup
(entityClass, idClass)pairdescribeIdFields(idClass)introspects records, Kotlin data classes / POJOs,and
@JvmInline value classwrappers. Simple types (String/primitives/UUID/enums/BigInteger/BigDecimal) return an empty descriptor list so the frontend
keeps a single input
deserializeEntityIdhandles primitives directly, unwraps Kotlin valueclasses through their public constructor, and lets Jackson deserialize
JSON-encoded compound ids into the real typed id before invocation
Configurationparameter (wired through theenhancer) so it can build resolvers on demand
ProcessingContextis passed asnull- verified safe for the defaultannotation-based resolver which doesn't read it; custom resolvers that do
throw NPE, which is caught and falls back to the legacy path (no regression)
Relates: https://github.com/AxonIQ/axoniq-platform/pull/538