chore(af5): migrate to Axon Framework 5 using axon4to5 skill#26
Open
MateuszNaKodach wants to merge 18 commits into
Open
chore(af5): migrate to Axon Framework 5 using axon4to5 skill#26MateuszNaKodach wants to merge 18 commits into
axon4to5 skill#26MateuszNaKodach wants to merge 18 commits into
Conversation
…elling (recipe: aggregate)
…elling (recipe: aggregate)
…sPool (recipe: aggregate)
…essor) - WhenWeekStartedThenProclaimWeekSymbolProcessor: add @SequencingPolicy(MetadataSequencingPolicy, GAME_ID_KEY) - WhenWeekSymbolProclaimedThenIncreaseDwellingAvailableCreaturesProcessor: CommandGateway field → CommandDispatcher method param; forEach stream → CompletableFuture.allOf async pattern; add @SequencingPolicy - WhenCreatureRecruitedThenAddToArmyProcessor: add @SequencingPolicy; rewrite try/catch compensation → exceptionallyCompose - application.yaml: remove sequencing-policy YAML keys for items 6-8 (moved to @SequencingPolicy annotation); remove orphaned Automation_WhenWeekSymbol*_Processor key
…cessor) - DwellingReadModelProjector: add @SequencingPolicy(MetadataSequencingPolicy, GAME_ID_KEY) - GetAllDwellingsQueryHandler: add @SequencingPolicy; dual-role event+query handler - application.yaml: remove last sequencing-policy YAML key (Read_GetAllDwellings_QueryCache)
- command-gateway items 11-16: commandGateway.send(cmd, metadata) → .resultAs(Void.class) to convert CommandResult→CompletableFuture<Void>; MCP files insert .resultAs before .thenApply chain - query-gateway item 17: .get() → .get(5, TimeUnit.SECONDS) to add required timeout - query-gateway item 18 GetDwellingByIdRestApi: already AF5-shaped, no changes
- items 19, 20: GetAllDwellingsQueryHandler, GetDwellingByIdQueryHandler already AF5-shaped (idempotent success) - item 21 PaidCommandInterceptor: use message param directly, chain.proceed() replaces interceptorChain.proceed(), removed throws Exception
Path A.JPA: - new EventStoreConfiguration: explicit @bean EventStorageEngine using AggregateBasedJpaEventStorageEngine - HeroesOfDDDApplication: add @EntityScan for com.dddheroes.heroesofddd, org.axonframework, io.axoniq.framework Note: AF5 JPA schema change (domain_event_entry -> aggregate_event_entry) required out-of-band before runtime
- PaidCommandInterceptor: remove Repository dep, use CommandDispatcher.forContext(context); chain.proceed(message, context) - ResourcePoolConfiguration: remove Repository injection for PaidCommandInterceptor - WhenCreatureRecruitedThenAddToArmyProcessor: fix exceptionallyCompose return type via resultAs(Message.class) - EventStreamsRestApi: DomainEventMessage->EventMessage (non-generic AF5), EventStore->EventStorageEngine, source(SourcingCondition) - StreamProcessorsOperations: EventProcessingConfiguration->ApplicationContext, TrackingEventProcessor->StreamingEventProcessor, TokenStore->processingStatus() - SequencingPolicy import: fix wrong package (core.sequencing.annotation->core.annotation) in 4 files - pom.xml: remove isolated-* Maven profiles (axon4to5-isolatedtest scaffolding)
MateuszNaKodach
commented
May 15, 2026
Comment on lines
+29
to
+36
| List<EventMessage> readEvents(@PathVariable String streamId) { | ||
| var condition = SourcingCondition.conditionFor(EventCriteria.havingTags(streamId)); | ||
| var stream = eventStorageEngine.source(condition); | ||
| var events = new ArrayList<EventMessage>(); | ||
| while (stream.hasNextAvailable()) { | ||
| stream.next().map(MessageStream.Entry::message).ifPresent(events::add); | ||
| } | ||
| return events; |
Owner
Author
There was a problem hiding this comment.
TODO: Validate that.
MateuszNaKodach
commented
May 15, 2026
| public void reset(String processor) { | ||
| eventProcessingConfiguration | ||
| .eventProcessorByProcessingGroup(processor, TrackingEventProcessor.class) | ||
| applicationContext.getBeansOfType(StreamingEventProcessor.class).values().stream() |
Owner
Author
There was a problem hiding this comment.
TODO: It should use AxonConfiguration
MateuszNaKodach
commented
May 15, 2026
|
|
||
| if (command.getPayload() instanceof Command payload) { | ||
| public MessageStream<?> interceptOnHandle(CommandMessage message, ProcessingContext context, MessageHandlerInterceptorChain<CommandMessage> chain) { | ||
| if (message.payload() instanceof Command payload) { |
Owner
Author
There was a problem hiding this comment.
TODO: validate this behavior.
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.
No description provided.