Hello again,
I realized after-the-fact that you specified “no event sourcing”. I haven’t tried that out before, but I did look in the documentation for answers. Did you register your event handler? eg. annotating class as @Component with @EventHandler annotated methods.
ICYMI… Notice that the aggregate only has a @CommandHandler.
@Entity // Mark this aggregate as a JPA Entity
public class MyAggregate {
@Id // When annotating with JPA @Id, the @AggregateIdentifier annotation
// is not necessary
private String id;
// fields containing state…
@CommandHandler
public MyAggregate(CreateMyAggregateCommand command) {
// … update state
apply(new MyAggregateCreatedEvent(…));
}
// constructor needed by JPA
protected MyAggregate() {
}
}