This repo contains a sample application that I used to experiment with the Marten and Wolverine.
The application is a simple Pizzeria that takes orders via a REST API.
Marten
is used to store the orders and Wolverine
publish and subscribe to messages on RabbitMQ.
There are the following microservices in the application.
Pizzeria.Store
- Has to REST endpoints:
GET /menu
- Returns the menuPOST /order
- Takes an order
- Has to REST endpoints:
Pizzeria.Kitchen
- Simulates the cooking of pizzas
Pizzeria.Delivery
- Simulates the delivery of orders
Pizzeria.Store
receives an order on thePOST /orders
endpoint, stores as a document in the database, and puts a message on theorders
queue.Pizzeria.Kitchen
receives the messages off theorders
queue, simulates the preparation of the pizzas, and then puts a messages on theprepared-orders
queue.Pizzeria.Store
receives the message off theprepared-orders
queue, updates the order document to marks it as prepared, and puts a message on thedelivery-orders
queue.Pizzeria.Delivery
receives the messages off thedelivery-orders
queue, simulates the delivery of the order, and then puts a messages on thecompleted-orders
queue.Pizzeria.Store
finally received messages off thecompleted-orders
queue and updates the order document to mark them as delivered.
- Clone this repo.
- Run
docker-compose up
to start the RabbitMQ, PostgreSQL and Seq containers. - Run
dotnet run --project ./Pizzeria.Store/Pizzeria.Store.csproj
to start thePizzeria.Store
service. - Run
dotnet run --project ./Pizzeria.Kitchen/Pizzeria.Kitchen.csproj
to start thePizzeria.Kitchen
service. - Run
dotnet run --project ./Pizzeria.Delivery/Pizzeria.Delivery.csproj
to start thePizzeria.Delivery
service. - Send an order to the Pizza Store using the
POST /order
endpoint - Check the logs in Seq for each service to see the sequence of events.