AggregateLifecycle.createNew does not return Entity ID in CommandResultMessage
See original GitHub issueBasic information
- Axon Framework version: 4.5.5
- JDK version: 11
Steps to reproduce
// 1. Sending part:
reactorCommandGateway.send<FooId>(
CreateFooCommand(
id = FooId()
)
)
// 2. Command Handler
class Bar(){
@CommandHandler
fun handle(cmd: CreateFooCommand) {
createNew(Foo::class.java) { Foo(cmd) }
}
}
Expected behaviour
After Foo
’s creation, return FooId
in the CommandResultMessage
.
Actual behaviour
An empty String
is returned.
Issue Analytics
- State:
- Created 2 years ago
- Comments:7 (4 by maintainers)
Top Results From Across the Web
Configure aggregates in order to return id and version
what is best practice to configure axon framework in spring boot, that all aggregates return their Identifier + Version. after applying a command?...
Read more >Testing AggregateLifecycle.createNew() when created ...
I am having issues with testing an aggregate that creates another aggregate. @Aggregate class Foo { Id id; Id barId; @CommandHandler void handle ......
Read more >Index (Axon Framework core 4.0-M2 API) - javadoc.io
Exception indicating that the an entity for an aggregate could not be found. ... Returns the given commandResult as a CommandResultMessage instance.
Read more >In 2sxc, after an App.Data.Create(), is there a way to get the ...
Create (new record in a different Content-Type). Since .Create() doesn't return anything, what is the best, correct, or elegant way to get to ......
Read more >Axon 4.4 中文版文档(四) |
负载上用于查找消息应路由到的实体的属性默认为@EntityId注释字段的名称。 ... omitted no-op constructor, command and event sourcing handlers.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Sure, I’ll try my best to shift from Tester to Dev 😃
Hello @abuijze, thanks for the clarification, I got you. AggregateLifecycle.createNew() currently return the aggregate just like its name implies, I like it, but we shouldn’t play with the returned aggregate directly (Bypassing CommandBus) right? So the returned aggregate is pretty much useless? From this perspective, maybe return an ID is safer? 😃 Anyway, below is not ugly either @CommandHandler fun handle(cmd: CreateFooCommand) = createNew(Foo::class.java) { Foo(cmd) }.identifier()