You share the Data between the Domain and the Query Model?
I dont fully understand what you mean but,
When a command is dispatched, a CommandHandler uses the aggregate root to handle the command. Aggregate root fires DomainEvents.
=> Query layer related code listens to domain events and updates the query model. (Example: ClientTableUpdater)
Domain entities are first class objects but Query Model classes are just DTOs with getters and setters. We have Client as entity and ClientDetailsEntry as DTO.
The (generated?) table domainevententry looks like you can not replay e events - missing the >>event data?
To observe how events are replayed by the framework, you can follow these steps:
Click on sample client
put a breakpoint to EventSourcingRepository.doLoad() method
put a breakpoint to Client.handleClientNameChangedEvent() method
start server in debug mode
open the client that you changed
=> you stop at the doLoad() breakpoint
reach to this line:
Here the events will be replayed to initialize aggregate state.
=> hit the breakpoint of Client.handleClientNameChangedEvent()
So, we have to implement the handlers that handle state changes properly.
if i can force the query database to have a invalid state
You can do that by not listening to domain events and not updating query tables. So updating the query tables properly is our duty.
how to replay events to integrate new features
I added a test class to nijhof2axon. Please have a look at SampleEventVisitorTest
how i can monitor the system (maybe the command and event queue)
I would use Log4J logs (and maybe AOP techniques not to pollute the code.)
There seems to be an org.axonframework.auditing.AuditingInterceptor class but I haven’t ever used that.
17 Aralık 2011 19:25 tarihinde Reto <firstname.lastname@example.org> yazdı: