انتقل إلى المحتوى
أمين أبوزيد
درس مخطط لهMID-031-L07

عرض عملي: ساغا الطلب، المسار الناجح

  • الدرس 7 من 8
  • Mid-level
في هذا الدرس 3 موضوعات

هذا الدرس مخطط له. يعرض المخطط أدناه الموضوعات التي سيغطيها، ولم يُنشر الدرس الكامل بعد.

نص الدروس والتمارين باللغة الإنجليزية، بينما تبقى واجهة الموقع وعناوين الدروس بالعربية.

في هذا الدرس

build and run the orchestrated order saga. Prepares MID-031-LAB1.

تفاصيل المخطط المبدئي

خطوة بخطوة

  1. Show the saga table and the OrderSaga state machine inside orders.
  2. POST /orders creates the order PENDING and a saga row, and writes a ReserveStock command via the outbox.
  3. inventory replies StockReserved; the orchestrator moves to STOCK_RESERVED and sends AuthorizePayment.
  4. Planned mistake: handle StockReserved without 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.
  5. payments replies PaymentAuthorized; order becomes CONFIRMED, saga COMPLETED.
  6. Show the trace by correlation id across the three services.

التطبيق

طبّق هذا الدرس بمختبر الوحدة وتمارينها واختبارها.

المختبر والتمارين الاختبار

تعليم الدرس كمكتمل اختياري ويمكنك التراجع عنه في أي وقت. يبقى تقدمك محفوظًا في هذا المتصفح.

اكتب للبحث في المستويات والمراحل والوحدات والدروس.