axon cqrs without event sourcing

623 views
Skip to first unread message

Pankaj Sharma

unread,
Oct 6, 2017, 4:18:43 PM10/6/17
to Axon Framework Users
Hi,

I am evaluating the framework for one of the application that I am working on. I want to use the CQRS but I don't want to use the event sourcing for data storage. 
I know that one approach is to mark the aggregate as an entity.

Is there an alternative there. Can I just plug-in my custom repository which would create the aggregate from my own entity classes and stop axon from persisting the events. I want to use an event handler which would update the data in the database based on the event.

Thanks.


Allard Buijze

unread,
Oct 18, 2017, 7:37:51 AM10/18/17
to Axon Framework Users
Hi Pankaj,

if you don't want to use event sourcing, you can mark your aggregate as an @Entity (as well as @Aggregate) and use the GenericJpaRepository. When using Spring Boot, assuming your aggregate is called "MyAggregate", if you name that repository bean myAggregateRepository, it will automatically use that. Alternatively, you can specify the name of the repository bean in the @Aggregate annotation.

The Axon Spring Boot starter will also automatically give you an Event Store. If you don't want to store your events, specify an EventBus instance in your application context to override that behavior.

Cheers,

Allard

Op vr 6 okt. 2017 om 22:18 schreef Pankaj Sharma <panka...@gmail.com>:
--
You received this message because you are subscribed to the Google Groups "Axon Framework Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to axonframewor...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
Reply all
Reply to author
Forward
0 new messages