عرض عملي: ساغا الطلب، المسار الناجح
في هذا الدرس 3 موضوعات
هذا الدرس مخطط له. يعرض المخطط أدناه الموضوعات التي سيغطيها، ولم يُنشر الدرس الكامل بعد.
نص الدروس والتمارين باللغة الإنجليزية، بينما تبقى واجهة الموقع وعناوين الدروس بالعربية.
في هذا الدرس
build and run the orchestrated order saga. Prepares MID-031-LAB1.
تفاصيل المخطط المبدئي
خطوة بخطوة
- Show the saga table and the
OrderSagastate machine insideorders. POST /orderscreates the orderPENDINGand a saga row, and writes aReserveStockcommand via the outbox.inventoryrepliesStockReserved; the orchestrator moves toSTOCK_RESERVEDand sendsAuthorizePayment.- Planned mistake: handle
StockReservedwithout checking the current state; replay the reply and the saga re-sends the payment command. Fix: ignore replies unless the state matches, plus inbox dedup. paymentsrepliesPaymentAuthorized; order becomesCONFIRMED, sagaCOMPLETED.- Show the trace by correlation id across the three services.
التطبيق
طبّق هذا الدرس بمختبر الوحدة وتمارينها واختبارها.
تعليم الدرس كمكتمل اختياري ويمكنك التراجع عنه في أي وقت. يبقى تقدمك محفوظًا في هذا المتصفح.