CQRS - how to handle new report tables (or: how to import ALL history from the event store)

前端 未结 3 1754
心在旅途
心在旅途 2021-02-03 10:30

I\'ve studied some CQRS sample implementations (Java / .Net) which use event sourcing as the event store and a simple (No)SQL stores as the \'report store\'.

Looks all g

3条回答
  •  清歌不尽
    2021-02-03 10:47

    For example in Axon Framework, this can be done via:

    JdbcEventStore eventStore = ...;
    
    ReplayingCluster replayingCluster = new ReplayingCluster(
                new SimpleCluster("replaying"),
                eventStore,
                new NoTransactionManager(),
                0,
                new BackloggingIncomingMessageHandler());
    
    replayingCluster.startReplay();
    

    Event replay is an area that is not completely documented and lacks mature tooling, but here are some starting points:

    • http://www.axonframework.org/docs/2.4/event-processing.html#d5e1852
    • https://groups.google.com/forum/#!searchin/axonframework/ReplayingCluster/axonframework/brCxc7Uha7I/Hr4LJpBJIWMJ

提交回复
热议问题