Skip to content

Repository files navigation

🛒 Order Processing System – Microservices Architecture

A Kafka-based microservices project implementing a distributed Order Processing System, comprised of three independent services: Order, Inventory, and Payment. These services communicate asynchronously using Kafka topics to ensure loose coupling and high scalability.

Diagram

Diagram

📦 Microservices

1. Order Service

  • Accepts customer orders.
  • Publishes events to Kafka.
  • Listens for payment status updates.

2. Inventory Service

  • Listens for new order events.
  • Checks and reserves inventory.
  • Publishes success or failure events.

3. Payment Service

  • Listens for reserved inventory events.
  • Simulates/generates payment.
  • Updates payment status.

Each service has its own isolated PostgreSQL database instance for data encapsulation and autonomy (following the Database per Service pattern).


🔄 Kafka Topics

Kafka TopicDescriptionPublisherSubscriber(s)
order.created.v1Published when a new order is created.Order ServiceInventory Service
inventory.reserved.v1Published after inventory is successfully reserved.Inventory ServicePayment Service
inventory.failed.v1Published if inventory reservation fails.Inventory ServiceOrder Service
payment.generated.v1Published when payment is generated/simulated.Payment ServiceOrder Service
order.payment.updated.v1Published to notify order status update after payment.Order Service(For downstream services, if any)

About

Kafka Microservice Application for Order Processing

Topics

Resources

Stars

2 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages