项目
在 GitHub 查看
OKTAYKIR/EventFlow.Example
关于
DDD+CQRS+Event-sourcing examples using EventFlow following CQRS-ES architecture. It is configured with RabbitMQ, MongoDB(Snapshot store), PostgreSQL(Read store), EventStore(GES). It's targeted to .Net Core 2.2 and include docker compose file.
系统与基础设施实测星标增长
- 24小时
- 0
- 7天
- 0
- 15天
- 0
- 1个月
- 正在收集历史
各周期内的星标净变化,周期相互重叠,并非每日新增。缺失的测量保持空白。星标代表关注度,不代表软件质量。
README.md
原文EventFlow.Example
DDD+CQRS+Event-sourcing examples using EventFlow following CQRS-ES architecture. It is configured with RabbitMQ, MongoDB(Snapshot store), PostgreSQL(Read store), EventStore(GES). It's targeted to .Net Core 2.2 and include docker compose file.
Event Sourcing/CQRS Architecture
The most common CQRS/ES architecture would look like following diagram

The example consists of the following concepts, each shown below
- Aggregates
- Command bus and commands
- Synchronous subscriber
- Event store (GES)
- In-memory read model.
- Snapshots (MongoDb)
- Sagas
- Event publising (In-memory, RabbitMq)
- Metadata
- Command bus decorator, custom value object, custom execution result, ...
Configuration
var resolver = EventFlowOptions.New
.UseAutofacContainerBuilder(new ContainerBuilder())
.Configure(c => c.ThrowSubscriberExceptions = true)
.AddEvents(typeof(ExampleEvent))
.AddEvents(typeof(ResetEvent))
.AddCommands(typeof(ExampleCommand))
.AddCommands(typeof(ResetCommand))
.AddCommandHandlers(typeof(ExampleCommandHandler))
.AddCommandHandlers(typeof(ResetCommandHandler))
.ConfigureEventStore()
.ConfigureMongoDb(client, SNAPSHOT_CONTAINER_NAME)
.AddSnapshots(typeof(ExampleSnaphost))
.UseMongoDbSnapshotStore()
.RegisterServices(sr => sr.Register(i => SnapshotEveryFewVersionsStrategy.Default))
.RegisterServices(DecorateCommandBus)
.PublishToRabbitMq(RabbitMqConfiguration.With(new Uri(@"amqp://test:test@localhost:5672"), true, 4, "eventflow"))
.UseInMemoryReadStoreFor<Aggregates.ReadModels.ExampleReadModel>()
.AddJobs(typeof(ExampleJob))
.CreateResolver());
📦 Stack
🤝 Contributing
- Fork it ( https://github.com/OKTAYKIR/EventFlow.Example/fork )
- Create your feature branch (
git checkout -b my-new-feature) - Commit your changes (
git commit -am 'Add some feature') - Push to the branch (
git push origin my-new-feature) - Create a new Pull Request
✨ Contributors
Show your support
Please ⭐️ this repository if this project helped you!
📝 License
Apache-2.0 © Oktay Kır
探索相关项目
加载中…