عرض عملي: رفض الدفع وتشغيل التعويضات
في هذا الدرس 3 موضوعات
هذا الدرس مخطط له. يعرض المخطط أدناه الموضوعات التي سيغطيها، ولم يُنشر الدرس الكامل بعد.
نص الدروس والتمارين باللغة الإنجليزية، بينما تبقى واجهة الموقع وعناوين الدروس بالعربية.
في هذا الدرس
exercise the failure path end to end. Prepares MID-031-LAB1.
تفاصيل المخطط المبدئي
خطوة بخطوة
- Use a test card number that
paymentsdeclines. paymentsrepliesPaymentDeclined; the saga moves toCOMPENSATING.- The orchestrator sends
ReleaseStock;inventoryreleases the reservation; the order becomesCANCELLED. - Planned mistake: write the compensation assuming a reservation exists; trigger the decline before stock replied and it throws. Fix: tolerate a missing reservation and record the cancellation.
- Replay
ReleaseStockand confirm stock is unchanged the second time. - Add a timeout case: stop
payments; after the deadline the saga compensates.
التطبيق
طبّق هذا الدرس بمختبر الوحدة وتمارينها واختبارها.
تعليم الدرس كمكتمل اختياري ويمكنك التراجع عنه في أي وقت. يبقى تقدمك محفوظًا في هذا المتصفح.