.Net 6 Distributed Transaction sample with Kafka, Consul and Ocelot Gateway.
- Redirects Http calls to Microservices with Ocelot and Consul. (Service Discovery)
- Ocelot
- Consul
- Creates OrderPlaced event. (OutboxWorker sends event.)
- Consumes StockDecreased and StockFailed events.
- Consul implementation.
- Confluent Kafka implementation.
- CQRS implementation.
- Repository and UnitOfWork pattern implementations.
- Consumes OrderPlaced event.
- Creates StockDecreased and StockFailed events. (OutboxWorker sends event.)
- Consul implementation.
- Confluent Kafka implementation.
- CQRS implementation.
- Repository and UnitOfWork pattern implementations.
- Reads OutboxTables of Order and Stock Microservices.
- Sends events.
- Confluent Kafka implementation.
- Dapper implementation.
docker-compose -f docker-compose.yml up -d
NOTE: Enable "Auto Topic Create" for Kafka if you use different docker-compose.yml. Sample docker-compose.yml includes "Auto Topic Create" for Kafka. (TOPIC_AUTO_CREATE: 1)
To apply migrations follow this command on Package Manager Console for Order and Stock Microservices. (Set starting project to API and set default project to Infrastructure on Package Manager Console)
update-database