Context
Checkout calls payment, inventory and email in one request. It takes 2.4 seconds on a good day, and when the email provider hangs, orders are lost with it.
Rebuild it around a message queue: the request path records the order and answers fast; everything else happens behind a broker, asynchronously, and survives the crashes you will cause on purpose in VERIFY.
Requirements
What must be true — the how is yours.
-
R1
An order is never lost — even if a worker crashes mid-process.
rehearsed by D1
-
R2
A failed receipt email must not block payment or inventory.
-
R3
Processing the same event twice must not double-charge.
rehearsed by D2
Technical guidance
- ▸One queue per concern; assume duplicates.
- ▸Ack only when the work is durable.
Definition of done
All of them, or it isn't shipped.
-
○
the order survives and is redelivered
— not recorded yet
D1
-
○
the customer is charged exactly once
— not recorded yet
D2
-
○
checkout still responds, work resumes after
— not recorded yet
D3
-
○
The repo runs from a clean clone with docker compose up.
— not recorded yet
nothing recorded yet — running the drills fills these in
spec v1.0 · drafted with AI, human-reviewed