Skip to content

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

0 watching

Forks

Repository files navigation

Microservices Outbox Pattern

A .NET 8 sample demonstrating reliable event delivery between an Order Service and an Inventory Service using the transactional outbox pattern.

Architecture

Microservices outbox pattern architecture

The Order Service saves the business operation and its integration event in the same database transaction. A background publisher forwards the event to the message broker, and the Inventory Service consumes it to update inventory. This prevents events from being lost when a database write succeeds but message publication fails.

Services

  • OrderService — accepts orders, persists order data, and publishes OrderPlacedEvent messages through the outbox.
  • InventoryService — consumes order events and updates inventory data.

Run locally

  1. Configure the database and message broker connections in each service's appsettings.json.

  2. Restore and build both services:

    dotnet restore .\OrderService\OrderService.sln
    dotnet restore .\InventoryService\InventoryService.sln
    dotnet build .\OrderService\OrderService.sln
    dotnet build .\InventoryService\InventoryService.sln
  3. Start each service in a separate terminal:

    dotnet run --project .\OrderService\OrderService.csproj
    dotnet run --project .\InventoryService\InventoryService.csproj

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages