Hi,
I am new to Axon framework and working on an application using the framework. Following the CQRS tenants I would like to separate the Command and Query parts, the following is what I have implemented ,
Command App (DataStore A)
-------------------
- Created a Hibernate Repository by implementing the Axon AbstractRepository
- The above hibernate repository uses "org.springframework.orm.hibernate5.HibernateTransactionManager'
- The Transaction manager is set to the Command bus using the axon SpringTransactionManager
- The aggregates in the domain generate events when the states change
Query App (Data Store B)
------------------
- For this I used the Spring data JPA infrastructure, hence the "org.springframework.orm.jpa.JpaTransactionManager' had to be used.
- This app has event listeners listening to events generated from the Command App
- On receipt of the event it converts into a query specific entity and persists in the DB using the Spring Data Repository.
Note : Command and Query App are in the same JVM
Problem Statement
-------------------------
- The UnitOfWork is only aware of the transaction manager in the Command App, hence only the state of the aggregate is getting persisted in the Command DB, whereas the entities are not persisting
in Query App
Am I doing something wrong here or is my idea of CQRS flawed? I don't want to use Event Sourcing at this poing of time since I am new to Axon framework.
Any help will be greatly appreciated.
Thanks,
Ranjit