Skip to content
Discussion options

You must be logged in to vote

Great questions — these are exactly the trade-offs that cost teams the most time to get right in microservices. Here's how FreshCart handles each:

1. Coordinating stock reservation → payment → confirmation (and rollback on failure)

FreshCart uses a choreography-based saga via MassTransit + RabbitMQ. The sequence is:

OrderService publishes OrderPlacedEvent
  → InventoryService consumes it, reserves stock, publishes StockReservedEvent
  → PaymentService consumes it, charges the card, publishes PaymentSucceededEvent / PaymentFailedEvent
  → OrderService consumes PaymentSucceededEvent → transitions order to Confirmed

On payment failure:

PaymentService publishes PaymentFailedEvent
  → Invento…

Replies: 1 comment

Comment options

amasen02
Jul 19, 2026
Maintainer Author

You must be logged in to vote
0 replies
Answer selected by amasen02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant