Skip to content

LEarwax/product-flow

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ProductFlow

Overview

ProductFlow is a .NET microservice demo that demonstrates reliable asynchronous order processing using RabbitMQ, the outbox pattern, and an idempotent consumer.

It showcases how to safely persist and publish domain events while handling failures and duplicate message delivery.

Architecture • OrdersService (API + Outbox + Dispatcher) • NotificationService (Consumer + Idempotency) • RabbitMQ (message broker) • PostgreSQL (data storage)

Flow

  1. Client sends POST /orders
  2. Order and outbox event are saved in the same transaction
  3. OutboxDispatcher publishes events to RabbitMQ
  4. NotificationService consumes the event
  5. Idempotency check prevents duplicate processing
  6. Notification is stored

Key Concepts

Outbox Pattern Ensures events are not lost between database writes and message publishing by storing events in the database and publishing them asynchronously.

Idempotent Consumer Prevents duplicate processing by tracking processed event IDs and skipping repeats.

Eventual Consistency The system allows a delay between order creation and downstream processing to ensure reliability.

Failure Behavior • Outbox events are retried if publishing fails • Duplicate messages are ignored via idempotency checks • Failed consumer messages are currently rejected (no DLQ yet)

Tech Stack • .NET • RabbitMQ • PostgreSQL • EF Core • Docker

Running the Project

docker-compose up

Then:

dotnet run --project OrdersService dotnet run --project NotificationService

Test: POST /orders

Current Limitations • No dead-letter queue • No structured logging • No retry/backoff strategy • No UI

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages