https://github.com/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.
https://github.com/OKTAYKIR/EventFlow.Example
command-handler cqrs cqrs-es-architecture ddd domain-driven-design dotnet-core dotnetcore event-driven event-driven-architecture event-handler event-sourcing eventflow eventsource eventsourcing eventstore ges mongodb rabbitmq sagas snapshot-store
Last synced: 23 days ago
JSON representation
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.
- Host: GitHub
- URL: https://github.com/OKTAYKIR/EventFlow.Example
- Owner: OKTAYKIR
- License: apache-2.0
- Created: 2019-11-20T16:21:57.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2023-03-03T23:28:21.000Z (about 2 years ago)
- Last Synced: 2024-11-13T22:35:27.625Z (7 months ago)
- Topics: command-handler, cqrs, cqrs-es-architecture, ddd, domain-driven-design, dotnet-core, dotnetcore, event-driven, event-driven-architecture, event-handler, event-sourcing, eventflow, eventsource, eventsourcing, eventstore, ges, mongodb, rabbitmq, sagas, snapshot-store
- Language: C#
- Homepage:
- Size: 133 KB
- Stars: 201
- Watchers: 14
- Forks: 42
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-dotnet-core-applications - **EventFlow.Example** - DDD+CQRS+Event-sourcing example and contains following technology stack: [EventFlow](https://github.com/eventflow/EventFlow), [EventStore](https://eventstore.com), [RabbitMQ](https://www.rabbitmq.com), [MongoDB](https://www.mongodb.com), [PostgreSQL](https://www.postgresql.org), [Docker](https://www.docker.com) (Sample & Reference Applications)
README
# EventFlow.Example



[](#contributing)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](/build/docker-compose.yml).
## 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](https://eventstore.com/))
- In-memory read model.
- Snapshots ([MongoDb](https://www.mongodb.com/))
- Sagas
- Event publising (In-memory, [RabbitMq](https://www.rabbitmq.com/))
- Metadata
- Command bus decorator, custom value object, custom execution result, ...## Configuration
```csharp
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()
.AddJobs(typeof(ExampleJob))
.CreateResolver());
```## 📦 Stack
* [EventFlow](https://github.com/eventflow/EventFlow)
* [EventStore](https://eventstore.com)
* [RabbitMQ](https://www.rabbitmq.com)
* [MongoDB](https://www.mongodb.com)
* [PostgreSQL](https://www.postgresql.org)
* [Docker](https://www.docker.com)## 🤝 Contributing
1. Fork it ( https://github.com/OKTAYKIR/EventFlow.Example/fork )
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create a new Pull Request## ✨ Contributors
## Show your support
Please ⭐️ this repository if this project helped you!## 📝 License
Apache-2.0 © [Oktay Kır](https://www.linkedin.com/in/oktay-kır-phd-9402955a)